Welcome to WebmasterWorld Guest from 54.162.172.144

Forum Moderators: travelin cat

Message Too Old, No Replies

Safari file upload bugs / quirks

Two specific workarounds

     
11:00 pm on Apr 2, 2007 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 28, 2004
posts:192
votes: 0


I just had to solve two issues with file upload bugs / quirks in Safari. This issue has come up here before, but never been answered as far as I know, so I'm posting my solutions for posterity.

Issue #1. Files don't get uploaded

This happens if you set display:none in your onsubmit function, which is often used to hide the form during the upload. The part of the form that you hide will not be submitted. To avoid this problem, you can set display:none in an onclick event for your submit button, or avoid display:none altogether.

Issue #2. Safari intermittantly hangs during file upload

This was discussed here [webmasterworld.com...] with no solution.

It looks like the form is submitting, but it never makes it. Just sits there. This seems to have something to do with keep-alive. It's solved by adding an http header "Connection: close" to the page with the form. Note this is added to the page with the form on it-- not the page that you are submitting to.

Well I hope someday somebody sees this and it saves them the two hours I just lost.

4:41 pm on Apr 3, 2007 (gmt 0)

Senior Member

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2003
posts:3416
votes: 0


Thanks for posting zomega42!