Drag and Drop File Uploads in Adobe AIR

Posted on: 2008-05-26 14:25:37

After doing quite a bit of research and testing, it seems as though drag-and-drop file uploads in AIR can't have progress monitors. If I'm wrong, I'd really like to hear about it. Drop me a line... nick @ <this domain>

Looking through the Flash Documentation, it would appear that the Progress event for file uploads only fires from the FileReference object. You can't instantiate this object from inside Javascript. It appears to work if you use the select dialog box... <code type="javascript">file = air.file.desktopDirectory file.addEventListener( air.ProgressEvent.PROGRESS, function() { air.trace('this will fire') }); file.browseForOpen( 'Select File' );

and then upload the file, but doing something like this will never fire the event:

<code language="javascript">// inside drop event handler myfile = new air.File() myfile.url = event.dataTransfer.getData("text/uri-list") ur = new air.URLRequest('') ur.method = 'POST' myfile.addEventListener(air.ProgressEvent.PROGRESS, function (event){ air.trace('upload in progress') });

This isn't a show-stopper for this particular project, but knowing my audience, they are going to want to know what the status of the upload is.

It does strike me as rather strange that you can't monitor those kinds of uploads. Maybe it's coming soon? I hope.

Continue reading...

My New Love Affair With Adobe AIR

Posted on: 2008-05-25 14:29:01

While at php|tek this past week, I attended a session by "Ed Finkler": called "Building Desktop RIAs with PHP, HTML and Javascript in AIR": At first, I was skeptical. Surely, this was all too good to be true.

Duly inspired, I set off hacking on my own application. After a little while (roughly an hour), I had a fairly impressive mock-up of my application going.

After downloading some more apps from "Adobe Application Exchange":, the whole idea of what Adobe is doing with AIR finally hit me. This is opening up real rapid application development to a whole slew of people who don't know those "real" languages like C#, C++, Objective-C, or Java.

Anyway, it's awesome and you should try it out.

Continue reading...

php|tek 2008 - Let the fun begin!

Posted on: 2008-05-19 23:22:38

In Chicago for php|tek 2008. It hasn't even started, yet but fun has already begun. Met some really great people and learned that I need to idle in #phpc more.

The weather is great here! Tomorrow it's off to the city for some touristy stuff.

Continue reading...