4 Replies Latest reply on May 18, 2010 6:40 AM by Matt Le Fevre

    How to download files using FTP protocol

    Adobe Flex Forum

      Hi ,

       

                I am  downloading  files from server using the URLStream class using a http request.But I want to download these files from server, using

      the URL( file://filename.flv). The downloading happens when we use FileReference.download , but  the problem in this option is that the save window appears each time we try to download a file. Is there any option to download a file from the server without displaying the save dialog window.

       

      Can anyone help for this.

       

      Thanks & Regards,

      Joyce

        • 1. Re: How to download files using FTP protocol
          BhaskerChari Level 4

          Hi Joyce,

           

          If you are using Flex and Adobe AIR then you can download the media files(image and video) by using the URLLoader class in FLex and after the content is loaded you can write the contents to the location in your computer so that the assets will now be in you local pc...

           

           

          private

           

           

          function writeBytes():

          void

          {

           

          trace("\rStatus: writing file locally ");

           

          var directory:File = File.applicationStorageDirectory.resolvePath("Data");

           

           

          if(!directory.exists)

          {

          directory.createDirectory();

          directory = directory.resolvePath(currentImageName.toString());

          }

           

          else

          {

          directory = directory.resolvePath(currentImageName.toString());

          }

           

           

          var myFileStream:FileStream = new FileStream();

          myFileStream.open(directory, FileMode.WRITE);

          myFileStream.writeBytes(

          this.imgData, 0, this.imgData.length);

          myFileStream.close();

          }

           

           

          Hope this helps...

           

          Please kindly mark if it helped you..

           

          Thanks,

          Bhasker Chari

          • 2. Re: How to download files using FTP protocol
            Adobe Flex Forum Level 1

            Hi Bhaskar,

             

            Thanks for the reply.

             

            urlLoader also needs http request class, to download the file. My requirement is not to use the http request.


            I have done the file downloading using the urlstream,It is working fine.But i don't want to use any http request.

            Instead of using the http protocol i want to download the files using the FTP protocol(the url format should be file:\\filename.flv).

             

            Does Flex support this option


            I have tried with the url file:\\filename.flv,but not able download the files.


            If u have any idea, please let me know.

             

             

            Thanks in advance.

            Joyce

            • 3. Re: How to download files using FTP protocol
              BhaskerChari Level 4

              Hi Joyce,

               

              I think this is what you are exactly looking for...

               

              check the below link..

               

              http://ntt.cc/2009/08/23/how-to-upload-files-in-flex-ftp.html

               

              If this post answers your question or helps, please mark it as such.

               

              Thanks,

              Bhasker Chari

              • 4. Re: How to download files using FTP protocol
                Matt Le Fevre Level 4
                but  the problem in this option is that the save window appears each time we try to download a file. Is there any option to download a file from the server without displaying the save dialog window.

                 

                 

                nope, i don't think there is, it has already been discussed in this similar topic

                 

                http://forums.adobe.com/message/2803603#2803603

                 

                if it was possible to download files without displaying any notification, it would cause a massive security flaw, hence why i think it simply isn't possible in Flex.