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

RadUpload.UploadedFiles.Count = 0 after server validation

1 Answer 109 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Manoj
Top achievements
Rank 1
Manoj asked on 24 Aug 2010, 08:56 AM
Hi,

We are trying to upload a file using RadUpload control in one of the pages. There are some server side validations before the save will happen on the server. There seems to be some problem in the RadUpload control after the validation when the page is displayed back to the user to re-enter some of the invalid data. As soon as the page is returned to the user with the validation error, the RadUpload control seems to have lost the information of the selected file in the previous attempt to submit the data in the screen. We are not sure if this is happening because we have not set some flags to retain the selected file information in the control(may be in the view state or something as other controls do).

Can someone help us in this issue. I had raised a support ticket with telerik last week and I did not get any response so far.

Thanks,
Manoj

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 26 Aug 2010, 01:39 PM
Hello Manoj,

We have already answered to you in the support thread. I will share the answer here, for community reference.

Unfortunately RadUpload (as well as ASP.NET Upload) can't remember its value across the postback. This is actually a limitation of the browsers, which do not allow one to set the value of the <input type='file' /> element using scripts. Since the latter element is used to upload the files to the server, the uploaded files will be lost after a postback occur. The only thing that you can do in order to workaround this problem is to validate the rest of the inputs on the client, so that no postback is needed. Every postback will upload the files selected in the file upload, no matter whether it was a validation postback or a file upload postback.



Kind regards,
Genady Sergeev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Upload (Obsolete)
Asked by
Manoj
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or