Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Active Storage Direct Upload using IE11 #31531

Closed
10io opened this issue Dec 21, 2017 · 1 comment
Closed

Active Storage Direct Upload using IE11 #31531

10io opened this issue Dec 21, 2017 · 1 comment
Milestone

Comments

@10io
Copy link
Contributor

10io commented Dec 21, 2017

Steps to reproduce

Using Active Storage, upload a file directly to a service (tested with local and s3) using Internet Explorer 11.

Expected behavior

The file should be properly uploaded via javascript directly to the service.

Actual behavior

A Unable to get property 'url' of undefined or null reference is thrown:
screen shot 2017-12-21 at 11 06 16

This is due to a bug in IE 11: when using a XMLHttpRequest with xhr.responseType = "json", IE 11 will not automatically parse the response body (see here).

The faulty code line is here, when the property direct_upload is read from the response, an undefined is returned since reponse is a string and not an object.

I did workaround this by simply checking if the response body is a string and parse it with JSON.parse.

I can submit this fix but I'm not sure if Active Storage should support IE 11 or not. If that's not the case, feel free to close this issue.

System configuration

Rails version:
5.2.0.alpha 5c7e59a

Ruby version:
ruby 2.4.2

@10io 10io changed the title Direct Upload using IE11 Active Storage Direct Upload using IE11 Dec 21, 2017
@georgeclaghorn georgeclaghorn added this to the 5.2.0 milestone Dec 21, 2017
@vfonic
Copy link
Contributor

vfonic commented Dec 21, 2017

@10io IE11 is the latest version of IE, right? I'm pretty sure that, in that case, ActiveSupport supports/should-support IE11. (I'm no rails maintainer.)
I'd suggest that you create a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants