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

Insert Media (IE11): Selecting more than 1 image to upload, results in "Empty file upload result" errors #787

Closed
purplespider opened this issue Jun 25, 2013 · 18 comments

Comments

@purplespider
Copy link
Contributor

To reproduce (In IE11 Desktop):

  1. Click Insert Media
  2. Click Choose files to upload...
  3. Select a few image files, and click Open

Only 1 image will successfully upload, the rest will return "Empty file upload result" errors:

Tested in latest 3.2-beta1, in Windows 8, IE11.
Works fine in Firefox & Chrome. IE9 didn't allow selecting multiple images at once.

@kmayo-ss
Copy link
Contributor

kmayo-ss commented Jul 5, 2013

I have replicated this issue on IE10 (10.0.9200.16618) will look into resolving this issue

The error I am receiving on developer tools console is

SCRIPTS: Access is denied.

tiny_mce_gzip.php, line 1 character 112881

@kmayo-ss
Copy link
Contributor

kmayo-ss commented Jul 5, 2013

May be a similar issue

http://www.tinymce.com/develop/bugtracker_view.php?id=5694

@kmayo-ss
Copy link
Contributor

kmayo-ss commented Jul 5, 2013

@kmayo-ss
Copy link
Contributor

kmayo-ss commented Jul 5, 2013

IE10 does not allow uploading files via iframes looking at the network tab on Chrome the javascript is uploading the files by opening separate iframe to upload each file

@kmayo-ss
Copy link
Contributor

kmayo-ss commented Jul 8, 2013

IE10 has sandbox restrictions for iframes will try assigning a sandbox attribute to the iframe

http://msdn.microsoft.com/library/ie/hh772930.aspx

@chillu
Copy link
Member

chillu commented Jul 9, 2013

This seems to be fixed on the plugin demo: http://blueimp.github.io/jQuery-File-Upload/

So its just a matter of upgrading the library. Unfortunately that's not an easy process, because we've overwritten a few methods that changed significantly. I've made a start for this two weeks ago, Kirk maybe you want to pick this up? chillu/silverstripe-framework@6d76261

Alternatively, we could try to track down the specific fix in the lib and backport it, but given the amount of IE10 related issues on their tracker, we'll likely run into other IE10 related issues as well (our version is over a year old)

@chillu
Copy link
Member

chillu commented Jul 9, 2013

Given how intrusive an upgrade of the heavily customized library will be at this point in the 3.1 release, I'm removing the milestone.

@purplespider
Copy link
Contributor Author

Shame that this won't make 3.1. In the meantime would it be possible to make IE10 users only able to select a single image at a time, so that at least they won't be greeted with a list of errors?

@chillu
Copy link
Member

chillu commented Jul 10, 2013

That'd be an option, do you want to have a go at this? UploadField.js, amend the config with a conditinoal browser check after $.parseJSON(fileInput.data('config').replace(/'/g,'"')). The config option for limiting file selection is called maxNumberOfFiles

@purplespider
Copy link
Contributor Author

Just had a play with this, but that config option doesn't quite do what I was hoping. It still allows the user to select several files, and just throws a "maxNumberOfFiles" error when it tries to upload them:

I was hoping there would be a way to tell the "browse" dialogue to let the user only select a single file in the first place. Like with your standard HTML "file" field.

@chillu
Copy link
Member

chillu commented Jul 10, 2013

We're using an old version of the lib, so the docs at https://github.com/blueimp/jQuery-File-Upload/wiki/Options are not fully accurate for us. As a starting point, have a look for _adjustMaxNumberOfFiles()

@purplespider
Copy link
Contributor Author

It doesn't look like the selecting of a single file is controlled by the javascript, so it may not be as straightforward to insert an IE10 check.

From what I can tell:

  • The ability for a browse dialogue to let users select more than 1 file, is caused by multiple="multiple" on the HTML input field.
  • Currently the multiple HTML attribute is surrounded by an <% if $multiple %>
  • $multiple is set in UploadField.php based on the value of $allowedMaxFileNumber that is set in uploadfield.yml

Not really sure the best way to proceed.

@purplespider
Copy link
Contributor Author

This is still an issue on IE11, it also effects uploading multiple files to the Files tab:

I keep getting various clients hitting this problem, it would be great if someone more knowledgeable about the upload script than me would be able to take a look at this issue.

@simonwelsh simonwelsh added the 3.1 label Mar 16, 2014
@purplespider purplespider changed the title Insert Media (IE10): Selecting more than 1 image to upload, results in "Empty file upload result" errors Insert Media (IE11): Selecting more than 1 image to upload, results in "Empty file upload result" errors Jun 20, 2015
@purplespider
Copy link
Contributor Author

Still an issue in 3.2-beta1.

@colymba
Copy link

colymba commented Jun 21, 2015

Seems to be a similar issue than in this PR? Thought it would have fixed it? silverstripe/silverstripe-framework#3499

@purplespider
Copy link
Contributor Author

I saw that PR too, but unfortunately not:

@colymba
Copy link

colymba commented Jun 21, 2015

That PR silverstripe/silverstripe-framework#3499 actually fixed the same problem for normal uploadfield. Unfortunatly this only solved 1 part of the issue for asset admin.

From what I can see, in Asset Admin, the form do send all the files in one POST request (as it should with iFrameTransport) but those files don't get passed on to the Form or UploadField, only one gets through (hence the emptyFileUploadResult). I just don't know where in handling the form request the form files get trimmed...

@tractorcow tractorcow added this to the 3.1.14 milestone Jun 21, 2015
@sminnee sminnee removed this from the 3.1.14 milestone Jul 21, 2015
@tractorcow
Copy link
Contributor

html media dialog has been replaced in 4.x with a react based one. The scope of the original issue doesn't exist anymore.

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

No branches or pull requests

7 participants