I\'m trying to use valums ajax uploader. http://valums.com/ajax-upload/
I have the following on my page:
var button = $(\'#fileUpload\')[0];
var uplo
This component is sending an application/octet-stream
instead of multipart/form-data
which is what the default model binder can work with. So you cannot expect Request.Files
to have any value with such a request.
You will need to manually read the request stream:
public ActionResult Upload(string qqfile)
{
var stream = Request.InputStream;
var buffer = new byte[stream.Length];
stream.Read(buffer, 0, buffer.Length);
var path = Server.MapPath("~/App_Data");
var file = Path.Combine(path, qqfile);
File.WriteAllBytes(file, buffer);
// TODO: Return whatever the upload control expects as response
}