Flickr style multiple file upload with jQuery

Filed under ActionScript, Flash, Software, Tutorials, jQuery

A while back, Paul Gregoire introduced me to the jQuery JavaScript library. It didn’t take long for me to realize the power and elegance of this library. For the longest time, I’ve been wanting to take a shot at authoring a plugin for jQuery and I’ve finally gotten around to it. So, it is my pleasure to announce the creation of the jquery.transmit plugin. It is a flash-backed multiple file upload utility with a user experience similar to that of Flickr’s current uploader. The goals for the plugin were simple: Provide an easy-to-use interface, use flash to work around HTML and JavaScript based file upload issues, and wire it all together with jQuery. Getting started with the plugin is quite simple. Import the necessary CSS and JavaScript dependencies, edit the supplied HTML to your liking and invoke the plugin like so:

Code:
    $(document).ready(function() {
        $('#transmit').transmit('http://mysite.com/upload/');
    });

While the plugin is still very much in its infancy and should be considered a work in progress, it is my opinion that it is easier to shake out bugs using an iterative development process. So, keeping that in mind, I’m hoping that a couple of you brave souls will wander over to googlecode and give it a try. Constructive feedback is very much appreciated.

8 Comments

  1. Jason
    Posted October 6, 2008 at 3:36 pm | Permalink

    Just downloaded your file upload solution - very nice! What is the name of the image array that is submitted?

    Also, it would be nice to have a way to limit the number of files a user can upload.

  2. Posted October 8, 2008 at 8:51 am | Permalink

    @Jason:

    Thanks for the suggestions. The name of the image data variable is “Filedata”. I’ll look into adding the file number limit later this week.

  3. Jason
    Posted October 12, 2008 at 11:54 am | Permalink

    I’m getting a 2038 error on uploading the files, the upload completes, but it the file never appears in the set location, the target folder is set to 777, any ideas?

    Thanks

  4. Posted October 13, 2008 at 9:58 am | Permalink

    @Jason:

    My first guess is that your server-side script cannot handle the size or number of files you are attempting to load. You can configure the max file size for the uploader and I am working to add functionality to limit the number of files to be uploaded.

  5. Kevin Maxin
    Posted October 15, 2008 at 11:35 am | Permalink

    Greetings,
    the script appears to be uploading fine, but I have no idea where it is sending the file or what is happening. I have no way to monitor the uploaders actions

  6. Posted October 16, 2008 at 2:58 pm | Permalink

    @Kevin:

    If you run the plugin in Firefox with the Firebug extension, you’ll see debug statements from the upload SWF itself. That should give you an idea of what is going on behind the scenes.

  7. JM
    Posted October 17, 2008 at 11:00 am | Permalink

    HELLO, I and my programmer are trying to use your uploader but are getting errors… the current one is that when we click on upload the dialog doesn’t pop up… firebug says: empty string passed to getElementById()… any thoughts?
    thanks!

  8. JA
    Posted October 22, 2008 at 10:29 am | Permalink

    I’m having issues getting this to work in IE. Currently, I’m testing in IE7 and getting an error that will not allow me to even select files to upload. The error I am getting is:

    Line: 49
    Char: 5
    Error: Unspecified Error (gotta love IE)
    Code: 0

    I get the same line and char no matter which page this run from so I’m guessing it’s something in the jquery.transmit.js file. Any thoughts? Seems to work fine in FF/mac, FF/windows, and Safari.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*