#31037 closed defect (bug) (fixed)
Uploading files through media modal causes error in < IE10
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.1.1 | Priority: | normal |
| Severity: | normal | Version: | 4.1 |
| Component: | Media | Keywords: | |
| Focuses: | Cc: |
Description (last modified by )
Trying to upload a file in the Media Modal in IE9 and lower triggers a "File Download" popup because the "async-upload.php" endpoint now returns Content-Type: application/json since 4.1. IE9 and lower don't understand this content-type so trigger a file download dialogue.
This was discussed at some length with the introduction of the new Media Modal here: https://core.trac.wordpress.org/ticket/22446#comment:20 long story short - returning application/json is not usually a problem as jQuery automatically handles it for older versions of IE, however this particular request is handled by Plupload which does not handle this edge case.
Before [30354] this endpoint returned text/html as it's Content Type; however now wp_send_json_error and associated functions are used which triggers a Content-Type header of application/json.
I'm not sure what versions of IE is "officially" supported, but it would seem right now the upload file workflow feels broken in < IE10.
As @pento pointed out - r22845 from the linked thread above.
For 4.1.1, I think we should just revert those changes to
admin-ajax.phpmade in [30354].31037.diff implements an (untested) alternative for 4.2, simply add a
$content_typeparameter, so we're explicit in what we're sending so this doesn't happen again.. I'm not entirely sure I like the parameter, but since it's needed for older browsers, doesn't seem too horrible.