[webkit-help] Downloading file via GET request and performing AJAX requests concurrently (doesn't seem to work in Webkit-based browsers)

Ben throwaway at indietorrent.org
Fri Apr 27 09:48:52 PDT 2012


Greetings,

I have a "Download" button that, when clicked, initiates a complex
server-side process that results in a binary file being sent to the
user-agent. The download preparation process may require several
minutes, as it involves transferring large files over the network and
packing them into a ZIP archive.

My goal is to display download preparation progress to the user as the
download is being prepared. I have a PHP script that accepts a unique
download key and returns progress on the copying/packing operation via
JSON response.

The problem I'm having is that Webkit-based browsers (e.g., Chrome 18.0)
refuse to carry-out AJAX requests once the GET request for the binary
file has been made. The behavior is the same whether I request the
file-download script via conventional hyperlink (e.g., <a
href="file.php?file=file.zip">) or using JavaScript (e.g.,
"window.location.href = 'file.php?file=file.zip'" in conjunction with
preventDefault()). As soon as the user-agent has downloaded the file
completely, the AJAX requests are again carried-out as normal.

A bug has already been filed about this issue as it relates to POST
requests, and has been acknowledged as such (
https://bugs.webkit.org/show_bug.cgi?id=23933 ). Even though this issue
seems to be the same or related, I have been discouraged from discussing
it in the same bug report. So, I have come to the mailing list for guidance.

The equivalent POST-related bug, which is described in the context of
uploading files and reporting upload progress, mentions a workaround via
the XmlHttpRequest object. However, as there seems to be no "receive()"
equivalent to send(), I'm not sure how best to proceed.

Any insight is greatly appreciated.

Thank you,

-Ben



More information about the webkit-help mailing list