Skip to main content
Participant
March 4, 2013
Question

Does Air allow file downloads/transfers to desktop from inside app?

  • March 4, 2013
  • 3 replies
  • 763 views

Hello,

I am looking into writing an air application that I intend to put onto a usb thumb drive. If a Mac or Pc user plugged the said usb drive into their computer, would the user of the app be able to easily download/transfer files directly onto their desktop from the app with a push of a button?

Secondly, would I be able to display a progress bar showing how much time is left in the download/transfer?

Lastly, if Air is bad choice for this, does anybody have any other recomendations?

Thank you all in advance!

This topic has been closed for replies.

3 replies

NeoDevAuthor
Participant
March 18, 2013

Any one?

Thanks.

Known Participant
March 19, 2013

Yes if you build your app with captive runtime you can put it on a thumb drive and copy anything anywhere you want.

You cannot get the progress of any given file's copyTo(), it does not support that event.  However if you have lots of files, you could simply count them and average.  The progress bar won't be compeltely accurate, but even on the native OS those progress bars are always wrong.  (like windows knows how long that folder copy is really going to take...)  You could also try to do something tricky like use File.download() from a URLRequest built on file://, but I'm not sure it would work.  If you played around with it, you probalby could.

If you have enough files, just count the files and make the progress bar be a % of the number of files transferred.

Also remember to copyToAsync() so that it runs in the background and your progress bar is smooth.

EDIT: please note that a captive runtime will be windows or mac specific (and wont run at all on linux).  As a result if you need to give your thumb drive to people with both OS's you'll have to bulid your application twice.  Also you'll have to have access to both a windows machine and a mac to do that, since you cannot publish for mac on windows and vice-versa.

NeoDevAuthor
Participant
March 19, 2013

I cant thank you enough for taking a moment to answer my questions.