download file options

From: Date: Thu, 02 Nov 2000 20:18:42 +0000
Subject: download file options
Groups: php.windows 
Request: Send a blank email to php-windows+get-3643@lists.php.net to get a copy of this message
I've got a question about downloading files from PHP scripts. There's a clear way to upload a file, but downloading varies. Any link can be saved by right-clicking and selecting "Save Link As..." or something like that from the browser, which is one way. Some file links, if they aren't registered with a file type alias (I think), will cause a dialog box to pop up and ask if you want to open it or save it. Others will immediately open a Save As... dialog box when you click on the link. IE has the annoying property of overriding some things and asking if you want to open or save them rather than just viewing them (eg., a page with a link to a JPG file where IE isn't registered as the default viewer/opener for them) whereas Netscape is a little more forgiving. IE tends to automatically initiate file-open transfers in some situations where Netscape always opens up a Save As or Open/Save dialog box. I also find that if I associate anything with PHP file types, for example, then Netscape (and probably IE) will try to launch that app to display the file rather than having it be interpreted (what IE does with JPG files). This is all very confusing to naive users. Some folks haven't even got a clue what a "right-click" means, so you can't just adopt a practice of advising everybody to "right-click and select Save Link As..." But what if you've got a download button? How do you initiate a dowload and get a Save As dialog to come up? Is it much different if you start the download after loading another page? I'm trying to come up with one single, consistent way of handling this so everybody has the same experience (rather than the often unpredicatable variations you get with links described above). Ideally, I'd like to implement something similar to what ZD Net provides on their library downloads: there's a DOWNLOAD button you click, and then you get a page (with some meaningless drivel on it) and a note somewhere that says, "If the file doesn't start downloading relatively soon, click _here_ to try again". All the books I've seen discuss uploading files, but not stuff like this. I'd appreciate any light you could shed on it! Finally, slightly unrelated, how would I get the download button to open a new browser page rather than replace the current one (ie., another instance of the browser)? Thanks -David Schwartz

« previous php.windows (#3643) next »