Skip to content
This repository has been archived by the owner. It is now read-only.

iOS8 GM file input element does not allow files to be read client-side or uploaded to server #1284

Closed
rnicholus opened this issue Sep 10, 2014 · 43 comments

Comments

@rnicholus
Copy link
Member

@rnicholus rnicholus commented Sep 10, 2014

This is a serious bug that prevents any sort of file uploads in iOS8 Safari. There is no known workaround. Below is the content of the bug report I filed with Apple.

Summary:
It seems like there is some issue with access to the files associated with an <input type="file"> element.

A few big issues:

  1. FileReader can't seem to read any files associated with a <input type="file">.
  2. URL.createObjectURL with a file associated with the element returns an object URL that has no content when loaded.
  3. If files are uploaded to a server, even via a simple multipart-encoded form submit, no actual file bytes are sent with the request.

None of these issues occurs in Chrome on iOS8, only Safari.

Steps to Reproduce:

  1. Create a simple form with a file input and a submit button
  2. Create a simple PHP server that handles file uploads via a multipart encoded POST request.
  3. Load the page, select a file, press submit

Expected Results:
File is saved to the server.

Actual Results:
Either an empty file is saved to the server, or the page loading indicator spins forever after clicking submit due to the lack of file bytes included in the request by Safari.

Version:
8.0 (12A365)

Configuration:
iPad

@PatrickBK
Copy link

@PatrickBK PatrickBK commented Sep 11, 2014

I experience the same issue with iOS 8 GM as well as the previous beta. I see it happening on an iPhone 5s as well as an iPad Air

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 11, 2014

Yes, it seems Apple knew about all of these bugs, chose to ignore them and release a gold master anyway. Hopefully they come to their senses and fix this before release.

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 11, 2014

Wow, this sucks big time! How about adding a detection feature to FineUploader for iOS8 and Safari, so that we can ask users to switch to Chrome?

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 11, 2014

Even more strange: if you pin a website to your homescreen and then start it from there (run it as a single app), the upload works!

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 11, 2014

As you suggested, UIWebView does not seem to suffer from these issues.

Regarding your suggestion to encourage users to switch to Chrome - keep in mind that video uploads are not possible in Chrome iOS8 at this time due a bug described in #1283.

I've outlined all new and existing browser-based-upload issues present in iOS in a blog post published yesterday.

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 11, 2014

Yes I am aware of the Chrome issue(s), it was more of an example of a message to show. It could also be used to ask the user to pin the website to the homescreen, or just to point out the bug from Apple.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 11, 2014

Not sure what we are going to do yet, but it will likely be a decision we finalize shortly before iOS8 releases, just in case Apple fixes these issues and issues a new pre-release build.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 14, 2014

I'm going to have to explore the pinning workaround a bit more. It may be tricky or even impossible to distinguish between a page traditionally loaded in iOS8 Safari and one loaded via a home screen icon. If we can, we will have to display some sort of message for Fine Uploader UI integrations when using iOS8 on Safari. Maybe something similar to what we did in #680.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 16, 2014

@bjornbos Adding the site to your home screen does not appear to work around the issue for me.

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 16, 2014

Works for me on an iPhone with iOS8 GM. Did you start it from the home screen icon afterwards?

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 16, 2014

Yep.  On an iPad w/ iOS8 GM.  Seems like this is not a reliable workaround.

On Tue, Sep 16, 2014 at 3:14 PM, Bjorn Bos notifications@github.com
wrote:

Works for me on an iPhone with iOS8 GM. Did you start it from the home screen icon afterwards?

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

rnicholus pushed a commit that referenced this issue Sep 17, 2014
No way to work around this, so we just alert
the user.
#1284
rnicholus pushed a commit that referenced this issue Sep 17, 2014
rnicholus pushed a commit that referenced this issue Sep 17, 2014
rnicholus pushed a commit that referenced this issue Sep 17, 2014
rnicholus pushed a commit that referenced this issue Sep 17, 2014
@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 17, 2014

5.0.5-8 is likely to be released tomorrow. It will include code to alert iOS8 Safari users to the fact that uploads are not possible due to outstanding bugs in the browser. Users will be directed to use Chrome instead. This alert will only display for apps that run in iOS8 Safari. UIWebView containers are excluded from this alert, since they are not affected by this bug.

For Fine Uploader UI, the uploader container will be replaced with text explaining the limitation and directing users to Chrome. This is same approach we take for iOS5 users.

For Fine Uploader core/basic, or for any attempts to upload files via the addFiles or addBlobs API methods, an alert is displayed indicating that uploads are not possible in iOS8 Safari, and the user is directed to Chrome.

There are also new options in place to turn off this (and other) workarounds. See the blog post on iOS issues for more details.

@rnicholus rnicholus removed this from the 5.0.5 milestone Sep 17, 2014
@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 24, 2014

Looks like 8.0.1 fixes this issue and #990. Only tested on Safari w/ iPhone 5.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 24, 2014

@karpitsky Video uploads are working fine for me in 8.0.1 iPhone 5 w/ or without the multiple attribute on the file input. If you are still seeing an issue, please provide more info about your environment.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 24, 2014

Note that you will want to disable the workarounds coded into Fine Uploader 5.0.5.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 24, 2014

Looks like Apple pulled the 8.0.1 update due to even more serious regressions present in that build. So, this issue is only fixed for the few that were able to update to 8.0.1 and didn't run into any new issues.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 25, 2014

I've posted an update to the blog post associated with this and other iOS upload bugs. http://blog.fineuploader.com/2014/09/10/ios8-presents-serious-issues-that-prevent-file-uploading/

@scrummitch
Copy link

@scrummitch scrummitch commented Sep 26, 2014

Hey everyone, looks like 8.0.2 has been released, tested on my device and it all seems back to normal. They're also providing 8_0_2 as the userAgent so it will be a good idea to keep up the warnings for people stuck on 8.0 still.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 26, 2014

Wow, that was a really quick turnaround on 8.0.2.  I thought for sure it would be weeks before another release.  We’ll take a closer look at 8.0.2 in the coming days.  The workaround is tied to 8.0.x, but can be easily disabled via the workarounds option.


Sent from Mailbox

On Thu, Sep 25, 2014 at 8:04 PM, Mitch Flindell notifications@github.com
wrote:

Hey everyone, looks like 8.0.2 has been released, tested on my device and it all seems back to normal. They're also providing 8_0_2 as the userAgent so it will be a good idea to keep up the warnings for people stuck on 8.0 still.

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

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 26, 2014

It's still kind of buggy... I often get a forced page reload (crash) when uploading multiple items (iPad mini with 8.0.2).

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 26, 2014

@bjornbos Is this a new issue as of iOS8? What features do you have enabled on your uploader?

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 26, 2014

I'm trying to figure out whether this is linked to browser uploading or that the new iOS crashes the device more often in general. I will play around with this some more over the weekend.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 26, 2014

I just uploaded a handful of files and a video in iOS 8.0.2 on an iPhone 5 w/ scaling turned on (using Safari). Everything looks ok at first glance. Going to confirm on an iPad as well.

We'll release 5.0.7 that locks this workaround to anything older than iOS 8.0.2.

@rnicholus rnicholus added this to the 5.0.7 milestone Sep 26, 2014
@bjornbos
Copy link

@bjornbos bjornbos commented Sep 26, 2014

FYI: I never experienced the crash in the first upload session in the browser. For it to happen I selected multiple files, waited for these to be uploaded, and then started a new upload session without refreshing the browser.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 26, 2014

I'm not able to reproduce.

@bjornbos
Copy link

@bjornbos bjornbos commented Sep 28, 2014

Looks like there is difference between iPad and iPhone. On iPhone everything works smoothly, but on iPad the upload process crashes the browser frequently. I'm also getting this feedback from my users now...

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 28, 2014

I'll see if I can reproduce next week.  Unfortunately, iOS8 in general is a train wreck, and this is becoming more common with apple software.  You might want to encourage users tied to Apple devices to stick with iOS7, or, better yet, iOS6.

On Sun, Sep 28, 2014 at 3:46 PM, Bjorn Bos notifications@github.com
wrote:

Looks like there is difference between iPad and iPhone. On iPhone everything works smoothly, but on iPad the upload process crashes the browser frequently. I'm also getting this feedback from my users now...

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

@anazar
Copy link

@anazar anazar commented Sep 30, 2014

@rnicholus - any eta on the 5.0.7 release? 5.0.6 blocks uploading on ios 8.0.2... we'd like to re-enable uploading since it's supported now.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Sep 30, 2014

No ETA at the moment. You can disable the workaround via the new workarounds option. http://docs.fineuploader.com/branch/master/api/options.html#workarounds

@rnicholus rnicholus added 3 - Doing and removed 2 - Do labels Oct 1, 2014
@rnicholus rnicholus closed this in 7e69916 Oct 1, 2014
@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Oct 1, 2014

Fine Uploader 5.0.7, released today, will only target iOS 8.0.0 safari for this workaround.

@bjornbos
Copy link

@bjornbos bjornbos commented Oct 5, 2014

I found out that it is not the upload process that crashes the browser on the iPad with iOS8+, but it's the image scaling. I now change the scaling option parameter to false for iPad iOS8+ users, but you might want to build this into the iOS8 workaround feature as default.

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Oct 5, 2014

We will look into the iPad specific issue you have mentioned in the near future.

On Sun, Oct 5, 2014 at 10:26 AM, Bjorn Bos notifications@github.com
wrote:

I found out that it is not the upload process that crashes the browser on the iPad with iOS8+, but it's the image scaling. I now change the scaling option parameter to false for iPad iOS8+ users, but you might want to build this into the iOS8 workaround feature as default.

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

@jkodroff
Copy link

@jkodroff jkodroff commented Apr 8, 2015

@rnicholus What's your feel on the issues with iOS8? Have they been largely resolved with 8.latest, or are they still present?

@rnicholus
Copy link
Member Author

@rnicholus rnicholus commented Apr 8, 2015

This particular issue was resolved in iOS 8.0.1.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
9 participants