marufbd / MvcFileUploader

A nuget package for easy blueimp JQuery file upload plugin integration into an ASP.NET Mvc application

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Upload fails under IE

martyt opened this issue · comments

Per the "Content-Type Negotiation" section at https://github.com/blueimp/jQuery-File-Upload/wiki/Setup you should check the HTTP_ACCEPT header to determine what kind of content-type to set on the JSON response.

This will take care of it nicely, add to the UploadFile() controller method:

        string acceptHeader = Request.Headers["Accept"];
        if (string.IsNullOrEmpty(acceptHeader) || !acceptHeader.Contains("application/json"))
            return Json(statuses, "text/plain");
        else
            return Json(statuses);

the problem is for ie8, fixed for version 1.3.3

published at:
https://www.nuget.org/packages/MvcFileUploader/