This is a migrated thread and some comments may be shown as answers.

Uploading and processing a file; issue with inputstream type

1 Answer 205 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Derek
Top achievements
Rank 1
Derek asked on 23 Apr 2012, 11:41 PM
We are trying to upload and process some excel files; there is no need to keep the file, so ideally we'd just like to keep them in memory and do what is necessary without storing the file. We are using the Excel Data Reader, and that part of it is working correctly if we use the TargetFolder setting and save the file. However, if we try to process using only the filestream, there are problems.

The documentation says that the InputStream property returns a system.io.stream object, which is what the reader expects, but when we try to load that object into the excel data reader, the error is;

"Unable to cast object of type 'System.Web.HttpInputStream' to type 'System.IO.FileStream'."

The code is
Dim stream As FileStream = lsFile.InputStream


We've tried casting the inputstream to a system.io.stream object directly, but that also throws an error. The code is using an external class to do the processing, since it's something that is done from various places within the application.

Any suggestions? Anyone out there used RadUpload and processed Excel files on the server in this way?

1 Answer, 1 is accepted

Sort by
0
Accepted
Bozhidar
Telerik team
answered on 26 Apr 2012, 09:41 AM
Hello Derek,

Switch to RadAsyncUpload and the problem will be resolved.
 
Regards,
Bozhidar
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 now.
Tags
Upload (Obsolete)
Asked by
Derek
Top achievements
Rank 1
Answers by
Bozhidar
Telerik team
Share this question
or