PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a web application that allows users to download pdf files from the server. To control access to these files they are not in a directory that is visible from the web. When a user requests one of the files the code sets the necessary headers and writes the files bytes to the output. Using
No its not a URL, its a local file. The file however can be as big as 100Mb!
usleep() works perfectly to control de CPU. The problem that it incurs is that the the scipt can now exceed the maximum execution time (by default 30 seconds). It could be possible to play with the sleep time, this value and the maximum file size to find a solution but i fear that it would not be a very stable one.
Maybe i'll just have to allow users a direct link to these files instead of passing them through the php script.