Reputation: 305
I am having to ditch uploadify in favour of jQueryFileUpload to accommodate non-Flash mobile users on a web app. However, my upload.ashx handler does not receive anything in the post from jQuery.
$('#fileupload').fileupload({
autoUpload: true,
dataType: 'json',
url: webroot + 'handlers/Upload.ashx',
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo('#files');
});
}
});
The Handler code:
public void ProcessRequest (HttpContext context) {
HttpPostedFile postedFile = context.Request.Files["Filedata"];
}
Why does postedFile
return null
?
Upvotes: 3
Views: 3142
Reputation: 305
I figured it out:
HttpPostedFile postedFile = context.Request.Files.Get(0) as HttpPostedFile;
simples
Upvotes: 3