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

RadUpload or RadAsyncUpload?

4 Answers 270 Views
UI for ASP.NET AJAX in ASP.NET MVC
This is a migrated thread and some comments may be shown as answers.
Carl
Top achievements
Rank 1
Carl asked on 02 Aug 2010, 02:01 PM
I'm trying out the upload controls on MVC, but I'm having some small problems.

When I'm using RadUpload, the Progress is only showed on really large files. However when that happens, the controller action is triggered before recieving the file, so I get no file in the action, and later an uploaded file that the server never notice.

When I'm using RadAsyncUpload it seems to upload nicely, but I can't figure out how I should reach the files in the controller action when eventually posting the form.

Any ideas or opinions?

4 Answers, 1 is accepted

Sort by
0
Carl
Top achievements
Rank 1
answered on 02 Aug 2010, 11:04 PM
Wow. Debugging this was very interesting to me.
RadUpload with progress works, and I'll stick to that for time being.

Following are my observations:
If a breakpoint is placed in the controller at an early stage, the file will never be posted to the action. The action will just perform like no file has been entered in the form. After the fileupload is finished in the gui, nothing more happens at the server.

If no breakpoint exists in the action, the action is entered almost immediately after submit, and the first time Request.Form is accessed in code, the execution halts. It waits until the file is completely uploaded and the progressbar in the gui has finished.
After that the action is resumed.
This behavior can be observed by tracing. I guess it's implemented by some mutex in the Request.Form.
:)
0
T. Tsonev
Telerik team
answered on 05 Aug 2010, 04:10 PM
Hello Carl,

Thank you for sharing your findings with us and the community. When the debugger alters the behavior of the program.

RadAsyncUpload works in completely different manner and you won't receive the file in the controller directly. Normally, the file is uploaded to a handler and saved in a temporary folder until the page is submitted or the set timeout expires. You can skip this step and store the file directly in the handler as in the images uploader demo. Then you can submit information about the uploaded file as part of the form (for example database record ID). With this information the controller action should be able to locate it and process it.

I hope this helps.

Regards,
Tsvetomir Tsonev
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
0
sujith
Top achievements
Rank 1
answered on 08 Nov 2012, 02:01 AM
Hello, Tsvetomir Tsonev

Any update on this issue? The link you have provided doesn't seem to be working. 

Thanks
sujith
0
Plamen
Telerik team
answered on 09 Nov 2012, 06:57 AM
Hello Sujith,

 
Here is the link to the sample demo that shows RadAsyncUpload with custom handler. 

Hope this will be helpful.

Kind regards,
Plamen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
UI for ASP.NET AJAX in ASP.NET MVC
Asked by
Carl
Top achievements
Rank 1
Answers by
Carl
Top achievements
Rank 1
T. Tsonev
Telerik team
sujith
Top achievements
Rank 1
Plamen
Telerik team
Share this question
or