File Upload with Apollo and JavaScript
Written by on May 25th, 2007 in Ajax News.
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:
-
-
// Watcher logic
-
$( document ).ready( function() {
-
-
// Check for directory
-
var watching = runtime.flash.filesystem.File.desktopDirectory;
-
watching = watching.resolve( dir );
-
-
// Create it if it doesn’t exist
-
if( !watching.exists ) {
-
watching.createDirectory();
-
}
-
-
// Do the initial check and updating of the UI
-
update();
-
} );
-
Source: Ajaxian
Original Article: http://ajaxian.com/archives/file-upload-with-apollo-and-javascript