22
Jul
2009

multiple files uploader with preview on client side

Hi,

well it took a month but i’ve added some features to the image uploader,
so now it support multiple file upload , it still doesn’t have any progress bar as adobe decided to add the security feature (bug ?!) that allows uploading or downloading data from the server only triggered by a mouse click,
ok .. so the upload button supplies the click, but then after the first chunk is uploaded it should (and i read alot about it ..) continue the next chunk as it was triggered by the same click, but no no, it throws Error #2176 !!!
i sat hours trying to break this devil but nada …
so at the end, i packed all of the files in one post being sent to the server all at once to pass the damn bug!

the jpg encoding still needs some tweeking as it causes the computer to freeze for a second,

for now i added only a rotate function to the image, but you can add as much features as you want as you can download the source files.

feel free to comment and request features.

Source : multiple files uploader with preview on client side
Demo : multiple files uploader with preview on client side

update : v2.01 is out (29/9/09)

First i’d like to thank you all for the suggestions,  requests and support  for the work,

thanks to Swen for the french translation of the uploader , you can download the fla file here with the original v2.0 files here

i came across a great fix for adobe’s JPEGEncoder class , making it async – by Derrick Grigg ,

so i’ve implemented it in my uploader, so now it’s faster and has better performance.
plus some minor bug fixes.

i’ll try to implement xml language file so it will be easier to translate it to any language,
and will implement a better  javascript support + hopefully i’ll have time to create uploading preloader …

ENJOY!

* if you find this script usefull, help spread the word , use your favorite social bookmark tool to tell the rest ! *


http://www.adylevy.com/wp-content/plugins/sociofluid/images/digg_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/stumbleupon_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/delicious_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/furl_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/technorati_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/google_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/myspace_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/facebook_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/yahoobuzz_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/twitter_32.png http://www.adylevy.com/wp-content/plugins/sociofluid/images/meneame_32.png

68 comments »

  1. Shiva said,
    January 4, 2010 @ 11:35 am

    Hi ady,

    Nice work. In this application how can i name the image size taken from textfield and save the data to mysql database.

  2. Tom said,
    January 8, 2010 @ 4:34 am

    REALLY, REALLY nice script. I’d also just appreciate some exposed options to pass in the embed code like max width and height (a no brainer), limit on number of images to upload at once, and boolean option for rotation ability. Of course many many other good suggestions here. I’d also stick in a mime type list (or file extension) into the passed parameters. Thanks for your hard work on this!

  3. chuck said,
    January 12, 2010 @ 3:21 am

    Is there a way to get the download option? When I uploaded it it worked like a charm but I would like to have the option to download like in your demo.

  4. neenu said,
    January 16, 2010 @ 10:04 am

    I am unable to use this script in dotnet,file is not being uploaded.Please help..I am writing script like this:

    var flashvars = {};
    flashvars.path = “http://localhost:1194/website1″;
    var params = {};
    params.menu = “false”;
    params.scale = “noscale”;
    params.salign = “tm”;
    var attributes = {};
    attributes.align = “middle”;

    swfobject.embedSWF(”swf/imgUpload.swf”, “flashHolder”, “100%”, “100%”, “10.0.0″, false, flashvars, params, attributes);

  5. admin said,
    January 16, 2010 @ 12:37 pm

    this script is provided with php server side files,
    you will have to write your own asp.net files …

  6. PaDalton said,
    January 20, 2010 @ 12:48 am

    Hello!

    Your uploader is great but i have a problem …
    … how can i sent a variable to the receiveFile.php ?

    Need Help shortly !

  7. PaDalton said,
    January 20, 2010 @ 1:46 am

    i have it ;)
    over session var’s !

  8. Germanaz0 said,
    January 20, 2010 @ 4:42 pm

    Hello, first of all I would give you the thanks about this great script, then I would tell my litle problem, when I finish to upload an image, there say on the flash “Problems uploading” but the script uploads the image on the folder, dunno why is that.

  9. Germanaz0 said,
    January 20, 2010 @ 6:58 pm

    I found the bug, it was the set_timeout of the script, just delete that line and is working,the only thing that is not working is the last uploaded files, but doesn’t matter, I will not use that, thanks a lot for that script.

    Btw, I would ask to you if there is possible to put a limit on the uploads, for example limit the user to upload only 3 pics.

    Thanks again

  10. AleRivas said,
    January 21, 2010 @ 5:36 am

    Hello I would tell to you that I cant compile the fla don’t know how is

  11. villas said,
    January 21, 2010 @ 4:28 pm

    Thank you so much for this script. I implement my MG2 gallery with that and works so great and useful!

    MG2 = http://www.tangata.de/kh_mod/index.php?ln=en

    Regardz from Brazil

  12. admin said,
    January 21, 2010 @ 8:43 pm

    @alerivas – its cs4 …

  13. Germanaz0 said,
    January 22, 2010 @ 5:51 am

    it would be nice to replace that line ExternalInterface.call(’imgUploaded’); on main.as for ExternalInterface.call(’imgUploaded’,urlVariables.filepath); so we could catch all events I would work on it after :D.

    THanks for the script

  14. ranjit said,
    January 25, 2010 @ 9:03 am

    Millions of Thanks.. You are Rocking…

  15. t said,
    February 6, 2010 @ 1:01 am

    Hey,

    Good stuff!

    I’ve been working on something similar & thought I’d comment -
    I’ve had a request to implement onChange when the user browses for the image, to have the preview append into a table. So for example, in yours – each time the user selects to browse for another new image, the previous image sets & the next preview appends to the right then down row etc. essentially building a gallery on the fly.

    Cheers!

  16. Brian said,
    February 6, 2010 @ 6:58 am

    This is fantastic, been looking for a good example of this!

  17. JProm said,
    February 26, 2010 @ 6:37 pm

    Is there a way to disable the resize so I can get the original file? Or to set it higher than 640×480?

  18. Michel said,
    March 4, 2010 @ 8:36 pm

    Absolutely awesome !
    Am working on a similar -but not as cool- widget : http://flur.maurivard.com
    Good job !

Leave a Comment

 

»
  1. November 11, 2009 @ 2:21 pm

    [...] Creditos: Ady Levy – Matéria: article [...]