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

Multiple Controls

1 Answer 62 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
François
Top achievements
Rank 1
François asked on 30 Jun 2011, 04:40 PM
Hello,


I'm using Telerik 8.0.0.6 and RadAsyncUpload in a RadGrid to permit users to upload a file for each line (indicating documents to send).When i upload the first document, all is good, but when i select the second, i have an error indicating the file has not been found (In my code behind, i do only "SaveAs()"). When i look at the errors, I can see that the second file is the same as the first (s2ghv0sb.kka)
Each time it's the same fileName for each upload.


How can I specify a different name?


Thank you in advance.

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 05 Jul 2011, 11:12 AM
Hi François,

After a file is selected from the dialog window RadAsyncUpload starts uploading it into temporary folder with a unique name. When a postback occurs the file is moved to target folder(if TargetFolder property is set) with it's real name. On the server side the client state of the RadAsyncUpload control is reset and send it back to the client.
In your case after the file is uploaded an ajax postback is triggered and the file is saved correctly and the client state of the control is not reset. After the second file is uploaded and an ajax postback is triggered again. FileUploaded event is fired for the first RadAsyncUpload control and it is looking for a file that is already uploaded and an exception is thrown. The reason that happened is because the client state of the control is not updated from the RadAjaxManager.
My suggestion to achieve your scenario is to use custom handler and directly save the file without RadAjaxMnager. Please consult with the following demo for more information.

All the best,
Peter Filipov
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
AsyncUpload
Asked by
François
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or