Search code examples
flashactionscript-3downloadipfilereference

Is it possible to download multiple files from a remote location to a users hard drive with AS3 FileReference?


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?


Solution

  • 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).