Activate your free membership today | Log-in

Monday, April 28th, 2008

FancyUpload: Swiff meets Ajax

Category: Component, Flash, JavaScript, MooTools

FancyUpload

Harald Kirschner has created a new version of FancyUpload "a file-input replacement which features an unobtrusive, multiple-file selection menu and queued upload with an animated progress bar."

A good example is the Queued Photo Uploader which is coded by:

JAVASCRIPT:
  1.  
  2. var swiffy = new FancyUpload2($('demo-status'), $('demo-list'), {
  3.         'url': $('form-demo').action,
  4.         'fieldName': 'photoupload',
  5.         'path': '../../source/Swiff.Uploader.swf',
  6.         'onLoad': function() {
  7.                 $('demo-status').removeClass('hide');
  8.                 $('demo-fallback').destroy();
  9.         }
  10. });
  11.  
  12. /**
  13. * Various interactions
  14. */
  15. $('demo-browse-all').addEvent('click', function() {
  16.         swiffy.browse();
  17.         return false;
  18. });
  19.  
  20. $('demo-browse-images').addEvent('click', function() {
  21.         swiffy.browse({'Images (*.jpg, *.jpeg, *.gif, *.png)': '*.jpg; *.jpeg; *.gif; *.png'});
  22.         return false;
  23. });
  24.  
  25. $('demo-clear').addEvent('click', function() {
  26.         swiffy.removeFile();
  27.         return false;
  28. });
  29.  
  30. $('demo-upload').addEvent('click', function() {
  31.         swiffy.upload();
  32.         return false;
  33. });
  34.  

Posted by Dion Almaer at 8:37 am

++++-
4.4 rating from 70 votes

4 Comments »

Comments feed TrackBack URI

Pretty nice! The UI updates are cool, sliding by percentage “milestone” for lack of a better word, rather than moving a few pixels on each progress update call or what have you.
 
Would you say this has fulfilled your wish, Dion, for a progressively-enhanced multi-file uploader? (I forget the exact wording.)

Comment by Schill — April 28, 2008

Is a jquery port possible?

Comment by Aimos — April 28, 2008

Its not so much porting FancyUpload to JQuery. Its Swiff that needs to be ported - that the Flash/Javascript wrapper that this uses, which is part of MooTools.

See: http://blog.mootools.net/2008/2/12/what-s-new-in-1-2-swiff

Comment by Unfocused — April 28, 2008

Sweet! I’m working on a new site with MooTools (BSP: it’s http://www.myzog.com) and we’ve been wanting to improve the uploading for a while now. I think this might be just what we’re looking for. Particularly, we’re concerned with how clumsy it is to have users browse for an image, click upload and wait who knows how long with no progress indicator. We’re also using the default browse button because customizing it is such a pain.

It looks like this only works with MooTools 1.2 so we’ll have to upgrade MyZog first, in which case I may wait until 1.2 is out of beta. But, I hear that this is the final beta before it’s officially released, so it may be pretty stable.

In any case, thanks for the link and I will certainly be checking this out further.

Comment by jdempcy — May 5, 2008

Leave a comment

You must be logged in to post a comment.