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

UploadedFile file = UploadedFile.FromHttpPostedFile(Request.Files[inputFile.UniqueID]); always returns null

2 Answers 97 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
bdk0172
Top achievements
Rank 1
bdk0172 asked on 15 Oct 2009, 10:15 PM
I'm trying to implement the file upload with RadProgressManager and RadProgressArea based on your demo.  After selecting a file in the input control and clicking on the Submit button, "UploadedFile file = UploadedFile.FromHttpPostedFile(Request.Files[inputFile.UniqueID]);" is always null.  These controls are inside of an asp:UpdatePanel on a page that is using an asp:ScriptManager.  Not sure if that would cause any problems.

2 Answers, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 16 Oct 2009, 09:27 AM
Hello bdk0172,

The way you obtain the uploaded files is not correct. You should use the UploadedFiles collection of the RadUpload component. Example:

foreach(UploadedFile file in RadUpload1.UploadedFiles)
{
     string name = file.FileName;
}

Secondly, it is not possible to upload files using AJAX. This is a limitation of the XmlHttpRequest component, used in all AJAX frameworks for asynchronous calls to the application. In order to upload a file your application must perform a full page postback. More information on the topic can be found here.

All the best,
Genady Sergeev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
bdk0172
Top achievements
Rank 1
answered on 16 Oct 2009, 01:08 PM
Adding the trigger to the UpdatePanel did the trick.  Thanks for your help.
Tags
Upload (Obsolete)
Asked by
bdk0172
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
bdk0172
Top achievements
Rank 1
Share this question
or