Log in

View Full Version : download files into their computer



604sweetqt
01-13-2007, 02:09 AM
Is it possible to get the html for that...:confused:

I want to post music, video...etc for people to download from me and save it into their computer.

djr33
01-13-2007, 02:11 AM
You can't do it automatically... definitely not. (Downloading without their consent.)

But, you can suggest it. Just put "right click, save as" next to the link.

Using, I believe, .htaccess, you can specify outputting certain files as download only and using PHP you can output a file (fairly easily) and use a header for download. Internet Explorer can ignore this, though.

mburt
01-13-2007, 02:27 AM
And your server has to be set up for .htaccess, and might have a different file configuration name.

604sweetqt
01-13-2007, 03:20 AM
I don't really understand sorry

I don't wanna download from other people, I want to let people download files from me

is it possible...:confused:

yoshi555
01-14-2007, 05:01 PM
if you wanna do that put it into a zip file or a .wav and use the <a href="sound.wav">Download Music</a> and if you want ot put the music on ur site to <embed src="sound.wav"></embed>

Twey
01-14-2007, 08:32 PM
The ZIP is a very good idea. Most default configurations will either save a ZIP or open it, displaying the files inside, which will suit your purpose.

WAVs, however, are a very poor idea for distrubution over the Internet, due to sheer filesize. Stick your music in a ZIP as well.

mburt
01-14-2007, 08:45 PM
Links to music often try to play the music before downloading, same with images.

BLiZZaRD
01-14-2007, 08:48 PM
Links to music often try to play the music before downloading, same with images.

Specially if visitor has QT installed and set as default browser use for sound files. It's quite annoying really.

mburt
01-14-2007, 08:50 PM
Very annoying. I tryed to set up a page for music downloads and failed first attempt - for one, I have QT installed, and it would play instead - two, it would be unreliable, meaning some people might be able to download it, some being forced to play it.

BLiZZaRD
01-14-2007, 08:52 PM
Another option is to make a text link to the sound and add the "right-click on the link and save as.." instructions, but with a lot of sound files that may become a burden.

mburt
01-14-2007, 08:54 PM
I resolved it using php... I lost the page and forgot how to do it, so that's not much help :) I can remember some, but still not enough to share.

BLiZZaRD
01-14-2007, 08:57 PM
You could always set up a default download page, like what hotscripts and download.com do where they take you to another page and auto download it for you.

That is fairly simple to set up as well. Still a lot of coding though.

mburt
01-14-2007, 08:58 PM
That is fairly simple to set up as well. Still a lot of coding though.
"fairly" being a keyword there.

BLiZZaRD
01-14-2007, 09:01 PM
Depends on how customized you want to get, how crazy you want that page to be. If you don't really care you can find scripts set up and ready to go to do that already :D

Twey
01-14-2007, 10:01 PM
<?php
$download_dir = '../downloads/';
$fn = $_GET['file'];
if(strpos($fn, '..') !== false || strpos($fn, '/') !== false) die('Crack attempt.');
$ffn = $download_dir . $fn;
if(!file_exists($ffn) die('File not found.');
header('Content-Type: application/x-octet-stream');
header('Content-Disposition: attachment; filename=' . $fn);
readfile($ffn);
?>