This problem is directly related to RadControls but originates from the way StreamReader works. The problem is due to the fact that when creating a StreamReader/Writer from a stream, the stream is 'consumed' by the StreamReader and when the reader is closed the stream is disposed.
To avoid this behavior I would suggest you to use another (temporal) stream which copies the data from the original (file's stream) and use it to create the StreamReader, e.g.:
sender, RadFileExplorerEventArgs e)
ArrayList illegalStrings =
UploadedFileCollection _uploadedFiles = (sender
var myStream =
 fileData =
file.InputStream.Read(fileData, 0, (
myStream.Write(fileData, 0, fileData.Length);
StreamReader sr =
contents = sr.ReadToEnd();
"alert('Cannot upload files with <script> elements..');"
//cancel the event
// do I need to do something here? Tried file.InputStream.Position = 0;
I hope this helps.
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed