Download with PHP problem

sky

Verified User
Joined
Nov 12, 2004
Messages
321
Hello all.

I have 2 servers up to date and there is the same problem on both, and not only for me, but for all people and all Browser (just stoping the usual questions :))


The problem ?

When i download a file from this adress : http://www.graphiks.net/projets/myPHPupload/details/b978d88e-ad4b-4ee2-ad36-873e2cb0b38e (updated link (2))

while it is downloading, i cant clic on another link untill the download is over.


I try on another serveur the same script, and i can visit the website while im downloading.



This did not happen before ... i dont know when before whas :)


Have you got a idea from where the problem comes from ?


Edit : i forgot the server specs :

Os : fedora core 6

Installed version of PHP (CLI): 5.2.6
Installed version of Apache: 2.2.9
Installed version of ProFTPD: 1.3.1
Installed version of autoconf: 2.61
Installed version of automake: 1.10.1
Installed version of libtool: 2.2.4
Installed version of PCRE: 7.7
Installed version of curl: 7.18.2
Installed version of dovecot: 1.0.14
Installed version of MySQL: 5.0.51a
Installed version of Zend Optimizer: 3.3.3

Latest version of DA



Thx,
Sky

Ps : The title of the topic should be : Download with PHP problem and not Download width PHP problem.
 
Last edited:
I fixed the title for you.

Good question. I see the same issue using Linux/FireFox2.

I wonder if the issue is a setting in your version of Apache?

Jeff
 
Hello
Well, it can be i suppose, but i have not change it much at all.

If you whant ... (and have the time :)) i can let you have a look.

Im looking around, but i seem to be the only one ^^

Sky
 
Hello again,
I just tried rebuilding the apache conf with :

cd /usr/local/directadmin/custombuild
./build rewrite_confs

But, still the same (i restarted apache after)

I dont understand whats whrong ... its strange.

Sky
 
I have also re built apache... and still no change.
Perhaps its a problem with PHP ... my code, or php.ini ?

Is there a limitor in php.ini that could do this ?

Sky
 
I have now tested with another code for download, and still the same result.
I updated all per packages.

dont now what to do more ...

Sky
 
Hello again.

Well, i left this problem aside a while, but it is a real pain :)

So, here are the facts :
A link to download : (i dont whant this page to be indexed, pm if you have a idea)

The code that downloads :
PHP:
            header('Content-Description: File Transfer');
            header('Content-Type: application/octet-stream');
            header('Content-Disposition: attachment; filename='.basename($File->file_realname));
            header('Content-Transfer-Encoding: binary');
            header('Expires: 0');
            header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
            header('Pragma: public');
            header('Content-Length: ' . filesize($urlFichier));
            
            ob_clean();
            flush();
            
            readfile($urlFichier);
            exit;

So, when you download that file, try to navigate at the same time on the website...

Thx for any ideas ... i dont understand at all...
And, its the same on the 3 DA servers whe have.

I have the impression that the server does not allow 2 php threads from the same connexion... is that possible ?

Thx,
Sky
 
Last edited:
Well, i have found something ...
When i add a session_destroy() juste before the download code ... it works fine.

I you know why ... strange i find.

Sky
 
Well, i have found something ...
When i add a session_destroy() juste before the download code ... it works fine.

I you know why ... strange i find.

Sky
Apparently you can only have one connection at a time with sessions. I've read before about someone having a similar problem, but with database connections.
 
Back
Top