views:

28

answers:

3

Can I develop a Flash AS3 download swf that will let a user select a location on their hard drive to download files to and then start the download of multiple files (in the same way I can do with upload)? Or should I zip all the multiple files first and download zipped files to local disk.

My users will want to download potentially hundreds of images from a server to local disk so I dont want them to have to click save for each one. Will AS3 let me pass an array of filenames and store the location that the user originally chooses? I ask because this sounds like it would have been not allowed for security reasons.

any ideas?

A: 

As you heard, Flash does not allow downloading at all, for security reasons. The only way to download a file with Flash is to redirect the user to the file's URL and let the browser handle the download, so Flash is of little use when it's about downloads.

Your zipped files options seems to be the way to go.

Shtong
Not true. Flash does allow you to download using `FileReference`, but only one file at a time.
Sam
in AS3, FileReference has download() and upload() methods. Your post if false.
Adrian Pirvulescu
+1  A: 

Unfortunately Flash does not provide an API to download multiple files. FileReference can download a zip file containing multiple images, but not an array of image files.

When storing images in a zip, remember to turn compression off. It'll make processing the zip much faster and the images won't compress anyways (unless you're using bitmaps or some other ridiculous format).

Sam
thanks, that's good advice about compression.
undefined
A: 

You do not have the option to download multiple files at once, but you can code to download them one by one.

Listen for the Event.COMPLETE event on the FileReference object in use to start the next fine download.

Adrian Pirvulescu