3 Replies Latest reply on Jun 5, 2011 8:54 AM by kglad

    Download images

    A.kameshwaran Level 1

      Hi,

           In my application user has the option to download the images. But currently i need to download multiple images. How can i perform it.

      Any idea wil be helpful for me.

        • 1. Re: Download images
          adninjastrator Level 4

          Explain in detail how you are allowing downloading now.

          The more exact and descriptive your reply, the more likely you will get help.

          Adninjastrator

          • 2. Re: Download images
            A.kameshwaran Level 1

            If the user wants to download the image, he will click the download icon. In that,

             

            var fileRef:FileReference = new FileReference();
            var loadmc:MovieClip;
            download_mc.onPress = function()
            {
                var listener:Object = new Object();
                listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void
                {
                    loadmc.status_txt.text = (Math.abs(bytesLoaded / bytesTotal)*100) +"%"
                }
                listener.onComplete = function(file:FileReference):Void {
                    loadmc.removeMovieClip();
                    getURL("javascript:alert(' Download Completed ');");
                }
                listener.onHTTPError = function(file:FileReference):Void {
                    loadmc.removeMovieClip();
                    getURL("javascript:alert('" + "ComonHTTPErrorplete: " + file.name + "');");
                }
               
                listener.onIOError = function(file:FileReference):Void {
                    loadmc.removeMovieClip();
                    getURL("javascript:alert('" + "IOError: " + file.name + "');");
                }
               
                listener.onSecurityError = function(file:FileReference, errorString:String):Void {
                    getURL("javascript:alert('" + "SecurityError: " + file.name + "');");
                }
                listener.onOpen = function(file:FileReference):Void {
                    loadmc = _root.fullImg_mc.attachMovie("progress_mc","loadingmc",0);
                    loadmc._x = 0;//(_root.fullImg_mc._x)+(_root.fullImg_mc._width/2);
                    loadmc._y = 0;//(_root.fullImg_mc._y)+(_root.fullImg_mc._height/2);
                }
                listener.onCancel = function(file:FileReference):Void {
                    loadmc.removeMovieClip();
                    trace("onCancel");
                }
                fileRef.addListener(listener);
                var filename = _root.img_arr[temptot] + ".jpg";
                var url:String = "images/"+filename;
                fileRef.download(url,filename);
            };

             

             

            Which makes me to download the single image. What i need now is to download the multiple image.

            Is there any option to zip all the file ...? and download....?

             

            Give me some idea and hints

            • 3. Re: Download images
              kglad Adobe Community Professional & MVP

              you would need server-side coding to dynamically zip files.