homepage Welcome to WebmasterWorld Guest from 54.234.228.64
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
Forum Library, Charter, Moderators: travelin cat

The Macintosh Webmaster Forum

    
safari upload woes
webkit upload quirk
roshi_is_ok




msg:3341385
 9:02 pm on May 16, 2007 (gmt 0)

Just wanted to share some tribulations I had trying to get my html upload form working in safari. There is an old post on webmaster world that also covers these issues and correctly points out that if you use display=none to hide your file inputs before you submit your form, the files will not be posted. This is mostly true and the same thing happens if you set visibility to hidden. The post incorrectly states that this happens when your display value change is placed in the function called by your form's onSubmit event handler and states that a fix for this problem is to place the display value change in an onclick event for your submit button. A fix that does work is simply submitting the form first and then changing the display value. ex:

works in Safari:

formObj.submit();
fileInputObjToHide.style.display = 'none';

doesn't work in safari:

fileInputObjToHide.style.display = 'none';
formObj.submit();

The older post also references an article stating that safari can hang 30-40 percent of the time when you upload. I haven't looked into that one that much except to say I tried the solution in the post (using a connection close http header on the form page) and it didnt work. anyone known of a fix for this? at the moment i'm using php and in lieu of posting a lot of code heres the headers im sending (most are to prevent caching):

<?php
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header('Connection: close');
?>

 

whoisgregg




msg:3348651
 1:37 pm on May 24, 2007 (gmt 0)

Thanks for sharing your experience, roshi_is_ok! :)

And, Welcome to WebmasterWorld [webmasterworld.com]!

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / The Macintosh Webmaster
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved