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

RadAsyncUpload Control

1 Answer 49 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 21 Feb 2013, 03:27 PM
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

1 Answer, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 21 Feb 2013, 05:29 PM
Sorry. I got it. I should set the "TemporaryFolder", not "TargetFolder".
Tags
AsyncUpload
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Share this question
or