Renaming files when downloading it
<p>I want to rename file when user downloads it.</p>

<p>Right now, I'm sending content-disposition and content-length headers and then send file to user with fpassthru PHP function.</p>

<p>But there is 3 problems with this method:</p>

<ol>
<li>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.</li>
<li>If user cancels the download, PHP script continue to read and send the file</li>
<li>If user pauses the download, he cannot resume it later.</li>
</ol>

<p>Is there any nicer way to rename files on download?</p>
