Hi!
We are providing a service that ships .pdf files to remote browsers.
Upon request, we build the pdf file in a temporary area available in the virtual directory for our IIS service.
The problem I'm having is deleting the file after sending it. We don't want to have to operate another 'cleanup service'. We'd like to just delete the file 'inline'.
If I use a browser on the same machine, the file transfers and deletes fine. If we access the file remotely, when we delete the file after streaming, the file does not arrive at the remote browser. I'm thinking that it is some kind of timing issue where there is time to transfer the file to the browser before the delete, where on the remote, the file is not fully transferred before the delete occurs.
Here is how I'm doing this:
header("Location: " .$FilePathVirtual);
unlink($FilePath);
Both vars are pointing to the same file. One is just using the virtual pathing and the other has the 'full' path.
How can I put a check to see if the file is transferred before the unlink? Or is there an even better way to do this?
Thanks,
Slopoke