Single download file upload mechanism
<p>Sorry for the relatively vague title, I couldn't think of anything else.</p>

<p>So in short what I'm asking for is what would be an optimal (least resource intensive) way of creating a simple file upload service that would delete the file after the first download. Can be PHP or anything else (as long as it's relatively easy to implement). It's basically for streaming screenshots for a single user.</p>

<p>The first thing that comes to mind is simply doing a regular upload and then doing a readfile() followed by an unlink(). sendfile is obviously out of the question since then I don't have a way of executing code after the file has been transferred. But readfile() doesn't seem like such a good idea.</p>

<p>I wouldn't mind installing a separate daemon or something along those lines.</p>
