sending a file to the browser for download automatically
Posted: Sat Dec 14, 2002 9:38 pm
I'm wanting to write a script that will allow users to download a file without being able to see where the file's stored or be able to download it if he/she isn't logged in and a session created. I've seen lots of sites that have this for downloading files (sourceforge.net, tucows.com ect).
For example: sites will sometimes have something saying "download will start shortly, click here if nothing happens" and then the file is sent automatically after the page is loaded.
Has anyone done this before? I'm thinking maybe I have to send the appropriate headers and stream the output of the file I want to send??
Anyone have a suggestion?
thanks,
jeremy
For example: sites will sometimes have something saying "download will start shortly, click here if nothing happens" and then the file is sent automatically after the page is loaded.
Has anyone done this before? I'm thinking maybe I have to send the appropriate headers and stream the output of the file I want to send??
Anyone have a suggestion?
thanks,
jeremy