Uploading and processing a file; issue with inputstream type

Thread is closed for posting
2 posts, 1 answers
  1. Derek
    Derek avatar
    118 posts
    Member since:
    Oct 2008

    Posted 23 Apr 2012 Link to this post

    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?
  2. Answer
    Bozhidar
    Admin
    Bozhidar avatar
    1103 posts

    Posted 26 Apr 2012 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top