I want to rename file when user downloads it.
Right now, I'm sending content-disposition and content-length headers and then send file to user with fpassthru PHP function.
But there is 3 problems with this method:
- If I'm sending big (above 3-4Gb) files this way, then my PHP script runs too much time and may be killed by timeout.
- If user cancels the download, PHP script continue to read and send the file
- If user pauses the download, he cannot resume it later.
Is there any nicer way to rename files on download?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…