Account Options

  1. Sign in
Google Groups Home
« Groups Home
Form plugin: dealing with Safari upload 'stalling'
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Tim Molendijk  
View profile  
 More options Sep 28 2007, 12:44 am
From: Tim Molendijk <taw.molend...@gmail.com>
Date: Fri, 28 Sep 2007 04:44:13 -0000
Local: Fri, Sep 28 2007 12:44 am
Subject: Form plugin: dealing with Safari upload 'stalling'
Hello,

Safari has a bug which occasionally makes it 'stall' / 'halt' during
the post of a form that contains a file upload. I don't know under
which specific conditions this problem occurs, but the problem has
been reported by others as well. There is also a hack available to
solve this issue:
- http://www.webmasterworld.com/macintosh_webmaster/3300569.htm
- http://blog.airbladesoftware.com/2007/8/17/note-to-self-prevent-uploa...

I did a minor tweak to .ajaxSubmit and I suggest integrating it (or
something similar) into an upcoming release of the Form plugin.

What I did is modifying the following code block (in .ajaxSubmit):

    if (options.iframe || found) // options.iframe allows user to
force iframe mode
        fileUpload();
    else
        $.ajax(options);

into:

    if (options.iframe || found) // options.iframe allows user to
force iframe mode

        // Tim: hack to prevent Safari from 'hanging' during an
upload.
        if ($.browser.safari) {
            $.get(options.closeKeepAlive, fileUpload);
        }
        else {
            fileUpload();
        }
        // End Tim

    else
        $.ajax(options);

in which options.closeKeepAlive is the URL of a webpage, which should
be provided through .ajaxSubmit's options parameter. This webpage
should be just an empty page in which the 'Connection' HTTP header is
set to 'close'.

This hack solves the problem for me. Your opinions are appreciated.

Regards,

Tim Molendijk


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Alsup  
View profile  
 More options Sep 28 2007, 7:22 am
From: "Mike Alsup" <mal...@gmail.com>
Date: Fri, 28 Sep 2007 07:22:06 -0400
Local: Fri, Sep 28 2007 7:22 am
Subject: Re: [jquery-dev] Form plugin: dealing with Safari upload 'stalling'

Thanks for this, Tim.  Looks good!  I think I'll add it like this:

if ($.browser.safari && options.closeKeepAlive)
   $.get(options.closeKeepAlive, fileUpload);
else
   fileUpload();

}

Cheers!

Mike

On 9/28/07, Tim Molendijk <taw.molend...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Tim Molendijk  
View profile  
 More options Sep 28 2007, 11:21 am
From: Tim Molendijk <taw.molend...@gmail.com>
Date: Fri, 28 Sep 2007 15:21:54 -0000
Local: Fri, Sep 28 2007 11:21 am
Subject: Re: Form plugin: dealing with Safari upload 'stalling'
That's indeed more suitable library code. Great! Cheers.

On Sep 28, 1:22 pm, "Mike Alsup" <mal...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »