PDA

View Full Version : How to create a Download File


Chapo
10-02-2008, 03:23 AM
I have a song that i will like to people go to my site a download it with a single click... can i do that with DW...? Is there a way to do that in Flash ...?

(how this is called, downloading flies? )

domedia
10-02-2008, 05:09 AM
Just use a regular link to the file:
<a href="file.mp3">Link for download</a>

Chapo
10-02-2008, 04:15 PM
I just add that code to the link and people are going to be able to download the song ? Can i also add this code in Flash ?

Chapo
10-02-2008, 11:22 PM
I tried to do whay you said... but it didn't work.... Can you explain it again with more detail please .... Thanx

domedia
10-03-2008, 12:19 AM
It's just a regular link, if it didn't work then you're not linking to the file. :)

Chapo
10-03-2008, 02:44 AM
Ok it works but it only downloads to listen the song, but i want it to download it in visitors computers so they can have the song.

edbr
10-03-2008, 02:59 AM
what about putting it in a zip file then. they can download that

Chapo
10-03-2008, 03:17 AM
Thats sound great.... how do i realize that ?
(sorry, still new in some things)

edbr
10-03-2008, 04:43 AM
i mean add the file to a zip (compress) if you have ie; song.zip it will be a straight forward download when called,do you have winzip program?

Corrosive
10-03-2008, 05:59 AM
Ok it works but it only downloads to listen the song, but i want it to download it in visitors computers so they can have the song.

Put a message on that asks viewers to 'right click' and select 'save as' (or whatever the Mac equivelant is) to download the song.

domedia
10-03-2008, 12:47 PM
Ok it works but it only downloads to listen the song, but i want it to download it in visitors computers so they can have the song. That's how it works on your computer. It's a local setting so it's going to be different from machine to machine.

Ricky55
10-03-2008, 05:15 PM
This is the code you would use in flash, Action Script 2 if you want AS3 get back to me and I write it for you.

Create button on the stage with the instance name of someBtn


import flash.net.FileReference;

var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);

var url:String = "http://www.yourdomain.co.uk/images/yourfile.jpg";

someBtn.onRelease = function() {
if(!fileRef.download(url, "3DrwLocker.jpg")) {
trace("dialog box failed to open.");
}
}

Chapo
10-04-2008, 01:31 AM
Nop, i don't have winzip, its that for Mac ?
Thanx Corosive... thats a smart one... i'll try that

Chapo
10-04-2008, 01:34 AM
Thanx Ricky.... thats code is usefull

Corrosive
10-04-2008, 06:42 AM
Thanx Corosive... thats a smart one... i'll try that

You know me mate. I'm not one for 'over-engineering' a solution :)

Chapo
10-04-2008, 06:11 PM
Hehe thats true corro... you rock the easy and smart way, the way it should nd meant to be...keep on rollin the good stuff dude..!!!

Ricky55
10-05-2008, 05:34 PM
The ability to zip files comes with all modern OS's including, Vista, Xp and Mac os.