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

Closed
MCF opened this Issue Sep 1, 2011 · 31 comments

Comments

Projects
None yet
@MCF
Contributor

MCF commented Sep 1, 2011

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)

@jonnyjc273

This comment has been minimized.

Show comment
Hide comment
@jonnyjc273

jonnyjc273 Sep 2, 2011

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)

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)

@MCF

This comment has been minimized.

Show comment
Hide comment
@MCF

MCF Sep 2, 2011

Contributor

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).

Contributor

MCF commented Sep 2, 2011

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).

@jonnyjc273

This comment has been minimized.

Show comment
Hide comment
@jonnyjc273

jonnyjc273 Sep 3, 2011

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?

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?

@MCF

This comment has been minimized.

Show comment
Hide comment
@MCF

MCF Sep 3, 2011

Contributor

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.

Contributor

MCF commented Sep 3, 2011

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.

@MCF MCF closed this Sep 3, 2011

@martinhorniak

This comment has been minimized.

Show comment
Hide comment
@martinhorniak

martinhorniak Sep 3, 2011

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.

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.

@jonnyjc273

This comment has been minimized.

Show comment
Hide comment
@jonnyjc273

jonnyjc273 Sep 3, 2011

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.

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.

@martinhorniak

This comment has been minimized.

Show comment
Hide comment
@martinhorniak

martinhorniak Sep 12, 2011

I encounter this issue only on windows and safari.

I encounter this issue only on windows and safari.

@MCF MCF reopened this Sep 12, 2011

@MCF

This comment has been minimized.

Show comment
Hide comment
@MCF

MCF Sep 12, 2011

Contributor

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.

Contributor

MCF commented Sep 12, 2011

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.

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Sep 13, 2011

Contributor

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?..

Contributor

jayarjo commented Sep 13, 2011

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?..

@jayarjo jayarjo closed this in 3096be3 Sep 13, 2011

@MCF

This comment has been minimized.

Show comment
Hide comment
@MCF

MCF Sep 13, 2011

Contributor

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.

Contributor

MCF commented Sep 13, 2011

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.

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Sep 14, 2011

Contributor

Hmm... you have a point :)

Contributor

jayarjo commented Sep 14, 2011

Hmm... you have a point :)

@jayarjo jayarjo reopened this Sep 14, 2011

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Sep 14, 2011

Contributor

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

Contributor

jayarjo commented Sep 14, 2011

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

@MCF

This comment has been minimized.

Show comment
Hide comment
@MCF

MCF Sep 14, 2011

Contributor

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

Contributor

MCF commented Sep 14, 2011

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

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Sep 24, 2011

Contributor

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 :|

Contributor

jayarjo commented Sep 24, 2011

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 :|

@charleskoehl

This comment has been minimized.

Show comment
Hide comment
@charleskoehl

charleskoehl Oct 7, 2011

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.

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.

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Oct 7, 2011

Contributor

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

Contributor

jayarjo commented Oct 7, 2011

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

@MCF

This comment has been minimized.

Show comment
Hide comment
@MCF

MCF Oct 20, 2011

Contributor

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

Contributor

MCF commented Oct 20, 2011

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

@ystar

This comment has been minimized.

Show comment
Hide comment
@ystar

ystar Nov 7, 2011

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

ystar commented Nov 7, 2011

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

@marcamillion

This comment has been minimized.

Show comment
Hide comment
@marcamillion

marcamillion Jan 20, 2012

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.

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.

@rjbrown99

This comment has been minimized.

Show comment
Hide comment
@rjbrown99

rjbrown99 May 20, 2012

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';
  }

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

This comment has been minimized.

Show comment
Hide comment
@charleskoehl

charleskoehl May 20, 2012

Thanks so much Robert!

On Sat, May 19, 2012 at 6:41 PM, Robert Brown <
reply@reply.github.com

wrote:

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';
 }

Reply to this email directly or view it on GitHub:
#363 (comment)

Charles Koehl
etherScapes http://www.etherscapes.com
808.778.2244

Thanks so much Robert!

On Sat, May 19, 2012 at 6:41 PM, Robert Brown <
reply@reply.github.com

wrote:

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';
 }

Reply to this email directly or view it on GitHub:
#363 (comment)

Charles Koehl
etherScapes http://www.etherscapes.com
808.778.2244

@frahugo

This comment has been minimized.

Show comment
Hide comment
@frahugo

frahugo Sep 23, 2012

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.

frahugo commented Sep 23, 2012

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.

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Nov 7, 2012

Contributor

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

Contributor

jayarjo commented Nov 7, 2012

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

@Felix10

This comment has been minimized.

Show comment
Hide comment
@Felix10

Felix10 Nov 10, 2012

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.

Felix10 commented Nov 10, 2012

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.

@actual-saurabh

This comment has been minimized.

Show comment
Hide comment
@actual-saurabh

actual-saurabh Jan 22, 2013

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

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

@actual-saurabh

This comment has been minimized.

Show comment
Hide comment
@actual-saurabh

actual-saurabh Jan 22, 2013

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

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

@michelechen

This comment has been minimized.

Show comment
Hide comment
@michelechen

michelechen Aug 12, 2014

I'm having issues in Safari on Mac even selecting a single file, specifically XML files. (although it works fine in Safari on Windows). Here is my code:

        this.fileUploader = new plupload.Uploader({
            url : this.fileUploadUrl,
            container : 'fileButtonContainer',
            browse_button : 'addFileBtn',               
            runtimes : 'html5,html4',
            multipart : true,
            multi_selection:false,
            multipart_params : {
                ParseMimeTypeFromName : 'true',
                ReturnStatusInBody : 'json',
                FileParameterName: 'FileName'
            },
            filters : [
                       {title : "XML files", extensions : "xml"},
                       {title : "Zip files", extensions : "zip"}
                       ],               
                       file_data_name : 'FileName'
        });

I am able to select zip files, but not xml files (they are grayed out and not selectible). Has anyone seen this before? Thanks in advance!

I'm having issues in Safari on Mac even selecting a single file, specifically XML files. (although it works fine in Safari on Windows). Here is my code:

        this.fileUploader = new plupload.Uploader({
            url : this.fileUploadUrl,
            container : 'fileButtonContainer',
            browse_button : 'addFileBtn',               
            runtimes : 'html5,html4',
            multipart : true,
            multi_selection:false,
            multipart_params : {
                ParseMimeTypeFromName : 'true',
                ReturnStatusInBody : 'json',
                FileParameterName: 'FileName'
            },
            filters : [
                       {title : "XML files", extensions : "xml"},
                       {title : "Zip files", extensions : "zip"}
                       ],               
                       file_data_name : 'FileName'
        });

I am able to select zip files, but not xml files (they are grayed out and not selectible). Has anyone seen this before? Thanks in advance!

@maxaral

This comment has been minimized.

Show comment
Hide comment
@maxaral

maxaral Oct 13, 2014

I had same issue

maxaral commented Oct 13, 2014

I had same issue

@gelinger777

This comment has been minimized.

Show comment
Hide comment
@gelinger777

gelinger777 Apr 7, 2015

Hi All, I have the same issue with multiple files in Chrome which I have reported at #1222 . Does anybody of you have similiar experience????? When you try to select multiple items it is always posting first one.

Hi All, I have the same issue with multiple files in Chrome which I have reported at #1222 . Does anybody of you have similiar experience????? When you try to select multiple items it is always posting first one.

@meilixie

This comment has been minimized.

Show comment
Hide comment
@meilixie

meilixie Aug 24, 2015

can plupload upload multiple files at once?
for example,I selected 4 files and I want to upload 3 files firstly at once, if there is one file finished then upload the last file

can plupload upload multiple files at once?
for example,I selected 4 files and I want to upload 3 files firstly at once, if there is one file finished then upload the last file

@jayarjo

This comment has been minimized.

Show comment
Hide comment
@jayarjo

jayarjo Nov 22, 2016

Contributor

I guess now that Apple has dropped Safari for Windows (quite a while ago already), we gotta close this one.

Contributor

jayarjo commented Nov 22, 2016

I guess now that Apple has dropped Safari for Windows (quite a while ago already), we gotta close this one.

@jayarjo jayarjo closed this Nov 22, 2016

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