Bryce C wrote: > Ok, not exactly on-topic but it does relate. > I'm trying to write a php script that passes a binary file through it > for download. This is to protect the file's true location (not web > accessible) and to allow my logger to log the transaction. > Unfortunately, the filename doesn't get copied. That is, the file to > download shout be x.tar.gz but I get download.php. Can someone help? > Note: I can't configure any of the services. > Note2: I know it's possible because I've seen other sites do it. > > Thanks, The content type application/unknown forces a download instead of the browser attempting to render it (as would be done with jpegs, text, html, etc). It's also possible to use application/octet-stream, but that's not dependable when the content is a jpeg or gif. Once you've started with those lines, you can read in whatever file you're downloading and write it out as if it were going to the screen. I use this all the time at work for creating downloadable tab separated value dumps of SQL queries.