Jump to content

Archived

This topic is now archived and is closed to further replies.

PixelNurse

Multiple Forced Downloads

Recommended Posts

Hey Guys,

I'm having an odd problem and I was wondering if anybody knew of a solution or could tell me what's going on...

I have a page where there are multiple files the user need to download. Each of the file links goes to a PHP page which has a GET parameter passed to it. The parameter is then used to identify the file to download. It reads out a file from outside the webroot and forces it to download. That's working great, however there is one problem. Once the user clicks one link the file starts to download, however if they try to click another download link while the first file is still transferring it doesn't start to download until the first file has finished.

Is it not possible for PHP to serve multiple files at once? Just to be clear I'm not trying to have one processed page serve multiple files, but have the same page be hit multiple times each time serving out a different file.

I'd really appreciate any thoughts you guys had as this is really got me stumped and I'm having a devil of a time trying to get anything out of google on this issue.

Thanks in advance for any thoughts!

Share this post


Link to post
Share on other sites
OK clearly something much broader is going on as it's not just the other files that can't be download, but no other PHP page will be served until the file download has completed. Can something be wrong with my PHP configuration or is it likely to be my file download that's doing something evil?

Share this post


Link to post
Share on other sites
many webservers only allow one simultaneous download per IP, could that be your problem?

edit: just realized how stupid I sounded.

more like "many webservers do not allow simultaneous downloads per IP", as one download can't be simultaneous :)

Share this post


Link to post
Share on other sites
Hmm... I don't think it's Apache as I'm able to download multiple files if I access them directly.

Share this post


Link to post
Share on other sites
arrrggg can anyone post anymore? I can't seem to post the code snippet. Ahhh I think it's because it contains header statements? That must be what that sticky post is about :)

Edit 2: oh no it isn't, hmmm.. wonder why i can't post php code? Makes it a bit tricky to get your guys wisdom on this issue

Share this post


Link to post
Share on other sites
OK I'm getting nowhere. I don't think it is actually a problem with the PHP configuration either because I've just tested a scaled down version on another server (Linux rather than OS X) and it does the same on that server too. Only difference being that the subsequent requests timeout due to a lower request timeout setting on that server.

So short of anyone having any ideas, does anyone know of a more hardcore PHP forum I could try and pick the brains of?

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.