Reputation: 16726
I have a user who is using the latest version of OSX and Safari. When he tries to upload a file through a form, it hangs (spinner spinning) but nothing happened. I did some reasearch and found this:
http://airbladesoftware.com/notes/note-to-self-prevent-uploads-hanging-in-safari
This fixed problems in previous versions of Safari, but obviously not Safari 5.
I was wondering if anyone else has any ideas how to resolve this? There was some mentioned of it being related to persistent http connections (thus the fix above) and I am using PHP (but I don't think that matters).
Upvotes: 3
Views: 1963
Reputation: 21
Well I found out that in my case the issue is definitely depending on the file content. When uploading a particular JPG file it fails in 8 from 10 attempts (Safari 5.5.1, but here's the seldom case where IE does a better job;-).
When loading and exporting the JPG file with Mac's Preview creating a new JPG fixes the problem disappears. Unfortunately nothing that helps to fix the problem but maybe worth to give Safari users a hint.
Upvotes: 2
Reputation: 18917
I've had some success sending the connection: close header to solve this issue.
Add
header("connection: close");
to the code that handles the file upload. It doesn't seem to solve the issue 100% but it certainly improves it. note that it's case sensitive: "Connection: close" won't work.
Upvotes: 1