Copying and editing a text file on server, and allowing a temporarily download with PHP?
<p>I would like to be able to copy a text file that's on my server, edit it based on the user input, and allow them to download the new file, but then delete it either after their session is done, or a certain amount of time. </p>

<p>I know how to copy and edit files, but I don't know how to make temporary files or a temporary directory, or how to dynamically name them... If multiple people are making files at once, I don't want to run into problems with making two files of the same name.</p>

<p>I've tried searching, but I'm not exactly sure how to phrase it. I've come across some pages on the PHP site about temporary files that are deleted as soon as the PHP stops running, but that wouldn't allow the users to download the file. </p>

<p>What exactly I would like to know:</p>

<p>-How to dynamically name copies of server files that are automatically deleted after a certain amount of time.</p>

<p>edit: Sorry, I know this might be more of a website problem than PHP, but I'm new to both. </p>
