Activate your free membership today | Log-in

Friday, May 25th, 2007

File Upload with Apollo and JavaScript

Category: Adobe, Articles, jQuery

Kevin Hoyt has posted a very detailed entry on a file upload component that he created with Apollo and JavaScript:

Let’s say that you take a lot of pictures. You take pictures, but you don’t want to think about how to upload them. You’d really like an application to monitor a directory for new images, and then upload them to a server. That kind of rules out the browser - it’s not going to be watching a directory on your desktop for image files, and then automatically uploading them. What about Apollo though? Couldn’t an Apollo application monitor a directory for me? Sure! Let’s make it happen…

The article walks you through the example, using jQuery, and gives details on the Apollo APIs:

JAVASCRIPT:
  1.  
  2. // Watcher logic
  3. $( document ).ready( function() {
  4.  
  5.         // Check for directory
  6.         var watching = runtime.flash.filesystem.File.desktopDirectory;
  7.         watching = watching.resolve( dir );
  8.  
  9.         // Create it if it doesn't exist
  10.         if( !watching.exists ) {
  11.                 watching.createDirectory();
  12.         }
  13.  
  14.         // Do the initial check and updating of the UI
  15.         update();
  16. } );
  17.  

Posted by Dion Almaer at 7:05 am

+++--
3.5 rating from 26 votes

4 Comments »

Comments feed TrackBack URI

It looks very nice. I guess it helps to visualize such a unpredictable uploading process. Thanks for your information.

Comment by Nick — May 25, 2007

Reminds me of ActiveX.

Comment by Jordan — May 25, 2007

And i wrote upload progress bar in JS&perl

Comment by dienow — May 26, 2007

좋은 글 보고 갑니다..

Comment by 조성현 — June 16, 2007

Leave a comment

You must be logged in to post a comment.