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!
Many users here mention about using readfile() in order to protect their files from leeching? Would readfile take more resources (bandwidth)? example, if i wanted to play a song with mp3 format, which one will result in more bandwidth use: using the Embed tag or readfile()?
Many users here mention about using readfile() in order to protect their files from leeching? Would readfile take more resources (bandwidth)? example, if i wanted to play a song with mp3 format, which one will result in more bandwidth use: using the Embed tag or readfile()?
Thanks!
as far as bandwidth goes, you aren't actually going to see a difference.. as far as resources goes, it's according to how big the file is and how big memory_limit is set to as it will only allow file sizes that match the maximum value of memory_limit.
The readfile function takes the whole file into memory at once.
How does the html embed tag works when embedding mp3 file? does it load the file onto the client as temp file? if this is true, would this help reduce resource on the server which hosts the mp3 file?