Hello,
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?
Thanks,
Warren
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?
Thanks,
Warren
6 Answers, 1 is accepted
0
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.
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.
0
July
Top achievements
Rank 2
answered on 19 Jul 2011, 02:12 PM
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";
this.DivUploadContainer.Controls.Add(radUpload);
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);
this.DivUploadContainer.Controls.Add(button);
}
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";
this.DivUploadContainer.Controls.Add(radUpload);
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);
this.DivUploadContainer.Controls.Add(button);
}
0
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
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!
0
July
Top achievements
Rank 2
answered on 21 Jul 2011, 03:22 PM
I deleted updatePanel at works perfectly.
UpdatePanel is not correct for RadUpload COntrol?
UpdatePanel is not correct for RadUpload COntrol?
0
Kevin
Top achievements
Rank 2
answered on 21 Jul 2011, 06:40 PM
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.
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.
0
July
Top achievements
Rank 2
answered on 22 Jul 2011, 01:00 PM
Yes, Thanks!!