RadUpload.UploadedFiles.Count = 0 after server validation

Thread is closed for posting
2 posts, 0 answers
  1. Manoj
    Manoj avatar
    11 posts
    Member since:
    Jul 2010

    Posted 24 Aug 2010 Link to this post


    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.

  2. Genady Sergeev
    Genady Sergeev avatar
    1600 posts

    Posted 26 Aug 2010 Link to this post

    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
Back to Top