Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: ocean10000
The file that corresponds to that key lives on a remote server: http://www.example.com/files/1234.pdf
What's the best way to get that remote file to the user, but hide the filename? I know how to set the Content-disposition header, I'm more interested in how I should best transport that file from the remote server to the local server and not leave behind orphaned files or use up all my RAM.
For example, if I download the remote file into a MemoryStream and serve it back to the user, there's definitely a possibility that I'll get OutOfMemory errors because of big files.
If I download the remote file and save it to disk, there's a chance the user could cancel the download and leave behind the temp file. Yes, I could create a scheduled task to clean up, but I don't really want to do that.
Is there a solution I haven't thought of, or so I just need to choose the least hassle of the ones I already outlined?