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

89 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 !

  19. Steve said,
    March 14, 2010 @ 10:08 pm

    who ever wrote this a bad boy – nice uploader / nice tut!!

  20. Alex said,
    March 17, 2010 @ 7:57 pm

    תודה רבה

  21. Simon said,
    March 18, 2010 @ 3:31 pm

    Hi Ady,

    I have a quick question: how did you workaround the AS3 Security in your app? I mean the URLLoader.load() function can only be user inherited.

    Thanks,
    Simon

  22. Raziel Sun said,
    March 18, 2010 @ 3:49 pm

    Hi!
    Whether and can prompt – whether probably to make so that by button “Upload” pressing in a text field “statusMsg” it was specified loading percent. How it to realise?

    Thanks

  23. Eric said,
    March 20, 2010 @ 9:15 pm

    I really like it, but if you select several files from the file browser thing, it seems to want to resize them all at the same time (at least, that’s what I’m assuming those progress bars are for) but this seems to cause it to (on my machine) take significantly longer than doing them sequentially would be and swallow up all my memory..

  24. Tokimon said,
    April 2, 2010 @ 1:40 am

    Hi
    Amazing tool. I think this is just what I’m looking fore :D
    Thanks so much for saving me 1000 of developing hours!

  25. Santosh said,
    April 18, 2010 @ 2:07 pm

    Hi Ady,
    You truly rock and your coding style is quite amazing.
    And thanks for this amazing application.
    I am using your application and I am doing a bit modification on it.
    For example I have image button and on browse it adds image strips just like yours one.
    But when I was trying to add scrollbars like yours ,on GridPresenter class where you instantiate Scroller class ,I get compile error
    1202: Access of undefined property x in package scroller.
    1202: Access of undefined property y in package scroller.

    I am still looking at the solution and from your view if you can say where I might be doing wrong while implementing it

    Again thanks for this great app.

  26. Santosh said,
    April 18, 2010 @ 2:42 pm

    Hi Ady,
    No need to look I found the error
    Actually the Scroller class was in package scroller
    And in my GridPresenter class ,I was instantiating
    like

    var scroller:Scroller;

    So I changed the package name to scroll and all went ok.
    Thanks again

  27. Shilpa uniyal said,
    April 19, 2010 @ 9:35 am

    hey….andy i have not received any of the solutions yet ma question is still the same……………………..sm1 please help me out!!!!!!!!!!!!
    how can i get to know the dpi of an image n then how can i reset it to make the pic good enough for printing.

    still waitin for the responce……..thanks

  28. Simon said,
    April 20, 2010 @ 8:33 pm

    Fantastic application, only one question. When I have uploaded the images, I am getting a message telling me ‘error uploading files.’. Despite this the pictures have successfully been uploaded and resized to the server. Can anyone advise me why this is happening?

  29. Sergio said,
    April 23, 2010 @ 11:00 pm

    Thanks a lot from Argentina for sharing this cool optimizer and multi uploader.
    I`d like to find a way to upload image by image, because when I upload several photos server doesn`t work.
    Once again, thank you.

  30. Mustafa Yavuz said,
    April 26, 2010 @ 10:35 am

    I have been trying your single uplaod programme, but gives “error!” mesaj.
    Do you check the programme and send me the source files.
    I will leave the credit

    Regards

  31. Dhaval Shah said,
    May 18, 2010 @ 3:59 am

    Hi,
    This is very nice project.I have 1 question.while opening .fla file in Adobe CS3 it will give me error. can you tell me how i can open this file .I have do some change in main.as file and now i want to build this file and convert into swf file.
    Please help me it’s urgent.

  32. Armen Naz said,
    May 18, 2010 @ 4:12 pm

    hi,
    first of all congratulations for the great project !!!

    I’d like to save images into a database instead of saving into a file-system !

    I work ASP and have managed to upload multiple files using a simple form, and the problem now is to resize them before “post”.
    After some research i finally got your solution which is perfect, only that you got it working on .php !

    Is it possible by modifying your scripts to manage to send images to an .asp file ( which saves post data to database ) or I’m on a totally wrong way ?

    thank you so much, and sorry for my bad English !

  33. french said,
    May 29, 2010 @ 6:38 am

    Hi, i recieve the same msg than Mustafa Yavuz, just say “error!”..Please help me

  34. Simon said,
    May 31, 2010 @ 11:10 pm

    Firstly this is a fantastic image upload facility. I do, however, need to be able to change the destination location folder for each upload. I can see where the folder is specified in the receiveFile.php file, but cannot see how to change that from outside of this file.

    I really hope someone can help me!

  35. Jerry Yang said,
    June 18, 2010 @ 12:19 pm

    thanks so much.
    i want to know how can i post more vars ( photo name, description etc.) to server when upload files.

  36. Kevin said,
    June 26, 2010 @ 2:01 pm

    I’m getting an Unexpected File Format when I try to open the fla in CS3… any suggestions?

  37. Alyxia said,
    July 3, 2010 @ 1:41 pm

    Thanks for sharing this…

Leave a Comment

 

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

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

  2. June 8, 2010 @ 3:35 am

    [...] Thema erledigt. Falls es mal irgendjemandem weiter hilft: Benutzt habe ich Version 2.1/ des Client Side Resize Skripts von adylevy.com. Hier muss leider die swf-Datei komplett neu [...]