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

AsyncUpload in Mvc application

1 Answer 33 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Sandhya
Top achievements
Rank 1
Sandhya asked on 07 Nov 2012, 08:52 AM
I am trying to use the AsyncUpload in an MVC application. Added the control to a view and all the client side validations worked fine. I am not able to figure out how to get my FileUploaded event handler triggered on file upload.

I added the following Action to one of the controllers, managed to get the submitted file through the form collection.
public ActionResult UploadFileToServer(FormCollection form)


I am recieving something like the following as part of the form["RadAsyncUpload1_ClientState"] member.

{'isEnabled':'true','uploadedFiles':[{"fileInfo":{"FileName":"New Text
Document.jpg","ContentType":"image/jpeg","ContentLength":7,"Index":0},"metaData":"/wEFsQF7IlRlbXBGaWxlTmFtZSI6Im5rMW10MGQxLjFxZSIsIkFzeW5jVXBsb2FkVHlwZU5hbWUiOiJUZWxlcmlrLldlYi5VSS5VcGxvYWRlZEZpbGVJbmZvLCBUZWxlcmlrLldlYi5VSSwgVmVyc2lvbj0yMDEyLjMuMTAxNi40MCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj0xMjFmYWU3ODE2NWJhM2Q0In2cjHHKucOwL9XHbTwMx7hNK3SkzeOs2R2WtBZJyOqw3w=="}]}
This seems like json representation of the FileUploadedEventArgs. Can someone let me know how to create the FileUploadedEventArgs type object with this, so that I can process the file contents?

Let me know if there is any other supported way of dealing with this control in MVC applications.

1 Answer, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 09 Nov 2012, 10:56 AM
Hello Sandhya,

The information that you get is the client state of the RadAsyncUpload control. It contains encrypted and summarized information about the uploaded files. I am afraid that is not possible to recreate FileUploadedEventArguments in the controler.

Regards,
Peter Filipov
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
AsyncUpload
Asked by
Sandhya
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Share this question
or