neurofuzzy, flash game development, rich internet applications, free source code - *alt.neurotica.fuzzy*

neurofuzzy, flash game development, rich internet applications, free source code - *alt.neurotica.fuzzy*

8/14/2006

Flash 8 Batch File Uploading

Filed under: Flash — geoff @ 9:33 am

I just added batch file uploading to Slideroll.  FileReference and FileReferenceList are great classes, and very easy to work with.  With good event-handling you can create a very usable interface for uploading photos.  The best thing about FileReference is the onProgress event, which allows you to track how many bytes of the file have uploaded - great for making progress bars.

FileReferenceList is simply a container for an array of FileReferences, so you can cycle through each one and upload it one at a time.  It’s a really nice feature to be able to upload only one file at a time.  That way, you can track the status of each file, and not worry about overloading your script on the other end with too many or too large of a file upload.

One tip, make sure that if you have scripted security limitations, such as logins, that you return and HTTP 1.0 error in your header, with no body, so that Flash knows that the file upload failed.  If you don’t, it’s possible that your script will reject the upload, yet return HTTP 200 ok.  Flash will think the file upload was successful, when it actuality your script rejected it.

You should also check the size of each file in Flash.  The FileReference class has a size property, so you can verify the size of the file and make sure it falls within the limits you’ve set on your server.

I have a Java photo uploader on my site that has great features like drag and drop and client-side resizing.  I almost favor the Flash implementation even without those features, just because of the usability enhancements Flash gives you.

1 Comment »

  1. I am trying to learn more about this new flash feature. Where can I learn more about doing this? I am trying to get something like thi implemented on my own site.

    Comment by Ed — 9/25/2006 @ 11:19 am

RSS feed for comments on this post. TrackBack URI

Leave a comment

 

Powered by WordPress