Answer the question
In order to leave comments, you need to log in
Is it possible to give multiple files through readfile()?
I use the readfile() function to return the file, before that I have formed the headers.
Everything works fine, there is no memory overflow.
But there is a small problem. If the file is large, and you need to give such 3-5 files, then you have to wait for the first one to load.
Let's move on to practice:
1. you need to give 2 files, the size of which is> 100 mb
2. before the user 2 links to the download, he clicks on the first one, the download of the first file starts
3. he clicks on the second link, and here, the most interesting, the download of the second file will not start until the first file is fully loaded.
What could be the problem? if not in readfile (), then tell me in which direction to dig?
Thank you for your attention )
Answer the question
In order to leave comments, you need to log in
Maybe somewhere there is a limit on the number of connections? Or downloading the first file completely clogs the channel?
Try to find out if the request is being sent.
In the browser F12 → Network, and see if the download starts.
You can also look at the access.log of the web server, at what point the request is being made. Or check with wireshark.
It's possible that the problem is with sessions - PHP, when storing the session in files, hangs concurrent requests other than the first one, until the first releases the session.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question