I seem to have run up against a bug in Safari's FileList but I'd like to see if anyone has any ideas on how to workaround the problem.

The HTML:

<input type="file" multiple="true" onchange="alert(this.files[0].size);" />

When selecting one file, the size is accurate. If two or more files are selected, 0 bytes is reported.

This isn't just a bug in reporting the size of the files, the File objects are empty - when I append a file to a FormData object and post via xhr, there is no data in the upload.

The uploads work fine in Firefox and Chrome.

有帮助吗?

解决方案

This appears to be a windows port bug and it affects any attempt to use multiple files, including a basic form submit:

file input size issue in safari for multiple file selection

https://github.com/blueimp/jQuery-File-Upload/issues/703

https://github.com/moxiecode/plupload/issues/363

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top