Skip to content
This repository

HTML5 Upload fails for multiple files on latest Safari for Windows #363

Open
MCF opened this Issue September 01, 2011 · 26 comments

11 participants

Mike Fellows Davit Barbakadze Jonathan Clift Martin Horniak charleskoehl ystar Marc Gayle Robert Brown Hugo Frappier Felix10 Saurabh Shukla
Mike Fellows

The current stable Safari for Windows has a bug that causes the upload of multiple files through the HTML5 runtime to fail. Curiously upload through HTML5 still works if only a single file is selected.

The problem seems to be related to the FileList object available through the input element. When more than one file is selected the file sizes are set to 0, the modification time is also set to 0. The resulting upload through the FormData object will upload a zero length (i.e. empty) file.

This bug does not seem to be a web-kit bug as the latest Chrome does not have the same problem.

I've logged an issue with Apple against Safari.

I've also created a basic test case that uses the same technique to upload files that plupload does using HTML5 on Safari. The test case is available here:

https://gist.github.com/1169709

(By the way I have not coded the test case to work around this webkit form bug which you may run into the second time you select files using the test)

Jonathan Clift

Ah, I think I may be experiencing this issue. When using Safari Version 5.1 (6534.50) but on a mac. I can upload individual files fine but when I attempt multiple files, the file progress % immediately jumps up to 100% for each file then drops back down to 45% for all but the last file. The files have still uploaded but only half of file is present. (For an image that is)

Mike Fellows

I haven't seen the problem you are describing with Safari 5.1 (6534.50). Testing on that browser with plupload (from a few weeks ago at least) and the reduced test case I mention above works fine. I was only seeing this issue with the newer build on Windows - Safari 5.1 (7534.50).

Jonathan Clift

Strange, I'm still encountering the problem although it is intermittent. Sometimes it seems fine, then after a reload it starts does the same thing as noted above, 100% immediately then dropping back down again. Any ideas what I could try to figure out what the problem is?

Mike Fellows

You could try the reduced test cased I mention above. If it doesn't happen with that then it must be something specific to plupload and your configuration of plupload.

Also try out your plupload app with other browsers I guess and look for the same misbehaviour.

Mike Fellows MCF closed this September 03, 2011
Martin Horniak

Ok I have run test case above and the result is:

Single File Upload:

  1. name: Desert.jpg, size: 845941, type: image/jpeg, last modified: Tue Jul 14 2009 07:32:31 GMT+0200 (Central Europe Daylight Time) UPLOAD COMPLETE

Multiple File Upload:

  1. name: Chrysanthemum.jpg, size: 0, type: image/jpeg, last modified: Thu Jan 01 1970 01:00:00 GMT+0100 (Central Europe Standard Time) UPLOAD COMPLETE
  2. name: Jellyfish.jpg, size: 0, type: image/jpeg, last modified: Thu Jan 01 1970 01:00:00 GMT+0100 (Central Europe Standard Time) UPLOAD COMPLETE
  3. name: Koala.jpg, size: 0, type: image/jpeg, last modified: Thu Jan 01 1970 01:00:00 GMT+0100 (Central Europe Standard Time) U

Check out the size value. This is the problem in test case too.

Jonathan Clift

Thanks for the reply. OK, so are you now encountering this issue on a mac too? I've tried in pretty much all other browsers, Safari, Firefox, IE, Chrome and do not encounter any similar issues.

Martin Horniak

I encounter this issue only on windows and safari.

Mike Fellows MCF reopened this September 12, 2011
Mike Fellows

Sorry, I hate github's "Comment & Close" button. I keep hitting it accidentally when adding comments to a bug. This bug is still open. And I can't find a workaround for this either - so it renders html5 useless on Safari. The only choice seems to be to use another runtime entirely.

Davit Barbakadze
Owner

Do not see it in Safari 5.1 (6534.50) on Mac. I could probably disable multiple file selection for Safari on Windows...

Sniffing... who said we could do without it?..

Davit Barbakadze jayarjo closed this in 3096be3 September 13, 2011
Mike Fellows

Do you really think this issue should be closed? I would think it would be better to leave it open until Apple fixes Safari on Windows and you can re-enable multiple file upload for that browser. The HTML5 runtime is not terribly useful for most users without the ability to select and upload multiple files at once - effectively killing it's use for most people on Safari for Windows.

Davit Barbakadze
Owner

Hmm... you have a point :)

Davit Barbakadze jayarjo reopened this September 13, 2011
Davit Barbakadze
Owner

Alas, Safari doesn't have it's own bugtracker.

Mike Fellows

No but the word on the street is that Apple tracks the number of bug reports for each issue and that helps them decide which to fix first. Feel free to re-report the issue if you'd like:

Free registration for the developer program:
http://developer.apple.com/programs/register/

Report an issue:
http://bugreport.apple.com

Davit Barbakadze
Owner

Btw, as I've exposed multi_selection feature, you could use required_features option to fall back to Flash or SilverLight if user comes in with Safari on Windows. HTML5 has got some very powerful upgrades recently to ignore it just because of one buggy browser :|

Ryan Demmer ryandemmer referenced this issue from a commit September 30, 2011
Commit has since been removed from the repository and is no longer available.
charleskoehl

The problem I am seeing is that if I try to upload a file over 2MB, it fails in Safari 5.1 on a Mac, but not Safari 5.1 on a PC. I can upload the same file with FF7, Chrome 16-dev, IE 9 on my PC.

Davit Barbakadze
Owner

Please more details on the failure, cause it's not a case on wide scale.

Mike Fellows
MCF commented October 20, 2011

The underlying Safari bug is still present with the latest release of Safari for Windows (5.1.1 - 7534.51.22).

ystar

The latest release of windows safari (5.1.2-7534.52.7) is still not good.

Marc Gayle

I would like to confirm that I, too, experience this issue on Safari 5.1.2(7534.52.7) on Windows and the latest build on OS X. Single file upload works...but multi doesn't. Btw, it works perfectly in Chrome on Windows (haven't tested OS X)...it's just Safari on both platforms that acts weird.

http://i.imgur.com/0uczd.png (each of those files should be 100kb or more, fyi)

Thoughts?

Edit: Just confirming that I did test on Chrome 16.0.912.75 on OS X and multi-file upload works. So it seems to be a Safari only issue.

Edit 2: I tested with Plupload v 1.5.2 and it works. Now I just have this Safari issue on Windows. Safari on OS X works with multi-upload.

Robert Brown

This is what I was doing for a while to work around this...

  $.browser.safari = ( $.browser.safari && /chrome/.test(navigator.userAgent.toLowerCase()) ) ? false : true;
  if ($.browser.safari) {
    var defaultruntimes = 'flash,html5,html4';
  }
  else {
    var defaultruntimes = 'html5,flash,html4';
  }
charleskoehl
Hugo Frappier

This fix breaks multiple file uploads on iOS 6 I think. It looks like the selected images all have the same file name "image.jpg". Maybe a check should be done on the platform.

Davit Barbakadze
Owner

Seems like 5.1.7 doesn't have this issue anymore. Anyone to confirm?

Felix10

Today I tested 5.1.7 on Windows 7 and the bug is still not fixed. With my old notebook with WindowsXP and version 5.0.3 multiple upload works perfectly.

Saurabh Shukla

Agree with @frahugo. All images get the same filename "image.jpeg"

Saurabh Shukla

So, in effect, only one file gets uploaded, while the rest are discarded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.