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:

    $(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.

Liked this post? Share it with others:
  • Digg
  • del.icio.us
  • Facebook
  • DZone
  • email
  • LinkedIn
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • TwitThis

15 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.

  9. hameed
    Posted January 1, 2009 at 10:13 am | Permalink

    Hi Carl,

    I have just downloaded your plugin and it is really looking cool. I was looking for some thing like this.

    The uploader seems to work fine in the browsers FF3.0.5 and IE 7 in Windows XP. But I got the following error in the Windows Vista (FF3.0.5). It would be great if you can give a look at it. I really appreciate you for the time you have taken to create this nice little plugin. Thanks!

    [SWF]: Processing allowed file types…
    [SWF]: Allowing types: *.jpg; *.gif; *.png
    [Exception... "'Error calling method on NPObject! [plugin exception: Error in Actionscript. Use a try/catch block to find error.].’ when calling method: [nsIDOMEventListener::handleEvent]” nsresult: “0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)” location: “” data: no]

  10. hameed
    Posted January 1, 2009 at 10:19 am | Permalink

    I guess the issue I have mentioned in my previous post may be because the plugin does not work in Flash 10 version.

    My Vista machine has (Flash 10) while my Windows XP has (flash 9)

  11. Posted October 7, 2009 at 5:24 am | Permalink

    I’ve download this script and it won’t show the link “Choose files to upload”, which loads the flash uploader, on FF3 (3.0.14), in the other hand, IE8 shows the link to upload and the flash correctly…

    any ideas? thanks in advance! :)

  12. Posted October 7, 2009 at 5:26 am | Permalink

    Oh, WIN7 is my OS, and my flash version is 10 (10,0,22,87)

  13. André Knuth
    Posted February 3, 2010 at 10:54 am | Permalink

    Got the same problem as viktor. Choose files to upload-link is not being generated.

  14. tom
    Posted February 4, 2010 at 8:37 am | Permalink

    The script does not work in Firefox. It would be great to describe how to use it. The information offered here is bad

  15. Posted May 12, 2010 at 12:17 am | Permalink

    grt

Post a Comment

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

*
*