I'm using http://aquantum-demo.appspot.com/file-upload to upload files to my site.
The file uploads fine in Firefox and Chrome, but when I try to upload it from IE 9 the file parameter in Controller action is null. Any ideas ?
Thanks in advance.
Here is my Controller action:
[HttpPost]
public JsonResult UploadFile(HttpPostedFileBase file, FormCollection collection)
{
var model = newObject();
TryUpdateModel(model);
model.ID = saveDocObject(model);
Guid fileid = saveUploadedFile(model.ID, file);
return Json(new { name = file.FileName, fid = fileid.ToString() });
}
Here is my View:
<div id="upload_files">
<div id = "filediv">
<input type="file" name="file" class="green"/>
<button>Upload</button>
<div>Upload it</div>
</div>
</div>
<table id="files" width="200px">
</table>
And finally my jquery:
$('#upload_files').fileUpload({
url: '/Document/UploadFile',
method: 'POST',
uploadTable: $('#files'),
downloadTable: $('#files')
});