tech_master
11-26-2004, 02:13 PM
How do you insert downloads on to your site give what ever you need to put my stuff onto a website for downloads:confused:
|
Click to See Complete Forum and Search --> : How do you put Downloads tech_master 11-26-2004, 02:13 PM How do you insert downloads on to your site give what ever you need to put my stuff onto a website for downloads:confused: PeOfEo 11-26-2004, 02:44 PM there are two good methods of creating a downloadable link. One is just a link to a file a browser cannot handle. For instance, if you want the user to download a movie or music, just put it inside of a zip file or something and the browser will prompt the user to download it because the browser cannot handle that type of file, nor can a plugin. The other way involves using the server to send a download header. This would require you to use something like asp.net, asp, or php though to get the server to send that proper header to the client so he or she is prompted to download the file. The advantage to doing it this way though is that you can have the user download whatever file type you want. GeorgeJohnson 11-26-2004, 03:18 PM To PeOfEo: I would greatly appreciate it if you would either post, or PM me, an example of how to force a file to be downloaded with PHP. PeOfEo 11-26-2004, 03:32 PM Originally posted by GeorgeJohnson To PeOfEo: I would greatly appreciate it if you would either post, or PM me, an example of how to force a file to be downloaded with PHP. You cant force a user to download anything. You can send a header to the user to give them a download prompt. Like on a site like download.com or something when your download is supposed to start automatically, that is the browser receiving a header and prompting you. I am not a php man myself, but I know how to do that with asp.net and asp classic. GeorgeJohnson 11-26-2004, 04:24 PM Sorry let me clarify myself, I don't mean to force the user, but when the user clicks a file, it opens the save dialog box. Such as for example I have an image gallery and I want to put a "Save" link under each image so when they click it, it opens the save dialog box. That way I don't have to put each every image file in a zip for it to be saved and they don't have to compress it, considering the files won't be that big anyways. PeOfEo 11-26-2004, 07:02 PM well this is definatly 100% possible. I have done something similar in the past with a primitive file manager I made. But it was made with asp.net. The only php I know is how to include a file with it. ray326 11-26-2004, 11:16 PM Well you can send the correct HTTP headers but you can't guarantee the user's browser will present a save as dialog. PeOfEo 11-27-2004, 12:15 PM Originally posted by ray326 Well you can send the correct HTTP headers but you can't guarantee the user's browser will present a save as dialog. True, but that is why one should always provide a link to the file as a backup. For instance, if your download does not start automatically, please click here. webdeveloper.com
Copyright Internet.com Inc., All Rights Reserved. |