RadAsyncUpload Control

2 posts, 0 answers
  1. Roger
    Roger avatar
    3 posts
    Member since:
    Sep 2011

    Posted 21 Feb 2013 Link to this post

    Hi,

    I need to use RadAsyncUpload to upload the files and then save the file into database in code-behind. Everything works fine except the "InputStream" throws a file not found exception. I looked at the folder where the files are uploaded. Originally, the file name contains a series of number then the actual file name. After post, the file got renamed back to the actual file name! That's why the UploadedFile.InputStream cannot find the file. If the file is renamed, the input stream should look for the file with the renamed file name.

    I can go around this problem of course, but I think you guys should fix this issue. (I have the latest version of Telerik library.) By the way, I can't use the "OnFileUploaded" event because I need to create my own object first. Then, these files are the attachments of my object.

    If you want to see some code:
    .aspx:
    <telerik:RadAsyncUpload runat="server" ID="rauAttachment" HideFileInput="true" MultipleFileSelection="Automatic" TargetFolder="~/UserFiles/Temp/" Localization-Select="Attach Files" Width="88" OnClientValidationFailed="RauValidationFailed" />

    .aspx.cs: Submit button click event:
    Stream stm = rauAttachment.UploadedFiles[0].InputStream; //File not found exception occurs.

    Regards,

    Roger
  2. Roger
    Roger avatar
    3 posts
    Member since:
    Sep 2011

    Posted 21 Feb 2013 Link to this post

    Sorry. I got it. I should set the "TemporaryFolder", not "TargetFolder".
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top