RadUpload File Lost on Postback

Thread is closed for posting
7 posts, 0 answers
  1. Warren
    Warren avatar
    7 posts
    Member since:
    Sep 2008

    Posted 15 Apr 2009 Link to this post


    I have a RadUpload control on a web form.  However, I'm storing a lot of additional information with regard to the file that is being uploaded in additional text boxes, combo boxes, etc.  Some of these values cause the page to post back, which normally would be fine because all of the information get's put into ViewState.  However, every time the page posts back, the Upload control loses the file that was selected and I have to select the file again.

    Is there a way to preserve the value of the file selected between post backs?

  2. Veselin Vasilev
    Veselin Vasilev avatar
    2992 posts

    Posted 16 Apr 2009 Link to this post

    Hi Warren,

    No, this is not possible.
    RadUpload does not support initially selected files or allow file selections to persist across postbacks. This is a security limitation of the standard <input type=file> elements which it uses internally for file selection.
    You can find the Known Limitations here.

    Sincerely yours,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 19 Jul 2011 Link to this post

    I' ve the same error...
    I need create the radupload control programatically...
    I created in PageLoad
    when click in Save button, this line is Zero: RadUpload1.UploadedFiles.Count
    But I upload a lot of file....
    What is the problem?

    This is my code:

     protected void Page_Load(object sender, EventArgs e)

                if (!Page.IsPostBack)



            private void buttonSubmit_Click(object sender, System.EventArgs e)
                Button btn = (Button) sender;
                RadUpload radUpload = (RadUpload)btn.Parent.FindControl("RadUpload1");      

                int g = radUpload.UploadedFiles.Count; --> Here is Zero

            protected void Page_Init(object sender, EventArgs e)

                RadUpload radUpload = new RadUpload();
                radUpload.ID = "RadUpload1";
                radUpload.InitialFileInputsCount = 1;
                radUpload.MaxFileInputsCount = 10;
                radUpload.ControlObjectsVisibility = ControlObjectsVisibility.Default;
                radUpload.TargetPhysicalFolder = VirtualPathUtility.ToAbsolute("~/TempFolder");

                radUpload.Skin = "Vista";


                Button button = new Button();
                button.ID = "buttonSubmit";
                button.Text = "Submit";
                button.Style.Add(HtmlTextWriterStyle.BackgroundColor, "#C1E3F7");
                button.Style.Add(HtmlTextWriterStyle.Color, "black");
                button.Style.Add(HtmlTextWriterStyle.FontFamily, "Arial, Century");
                button.Click += new EventHandler(buttonSubmit_Click);


  4. Dimitar Terziev
    Dimitar Terziev avatar
    1268 posts

    Posted 21 Jul 2011 Link to this post

    Hi Julieta,

    Please refer to the following help articles here and here giving information about the possible reasons for the experienced behavior

    Kind regards,
    Dimitar Terziev
    the Telerik team

    Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

  5. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 21 Jul 2011 Link to this post

    I deleted updatePanel at works perfectly.
    UpdatePanel is not correct for RadUpload COntrol?
  6. Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 21 Jul 2011 Link to this post

    Hello Julieta,

    If you place the RadUpload control inside an UpdatePanel, you need to ensure that the page performs a full postback, not an ajax one, because you can't upload files using an ajax request.

    I hope that helps.
  7. July
    July avatar
    205 posts
    Member since:
    Jul 2011

    Posted 22 Jul 2011 Link to this post

    Yes, Thanks!!
Back to Top