5 Replies Latest reply on Sep 4, 2006 7:59 PM by abeall

    URLLoader upload progress

    adam duston Level 1
      hi, i am using a URLRequest to POST a bunch of binary data (from a webcam, though that is irrelevant). i noticed that the progress event only catches download progress, not upload progress. is there any way to get the upload progress?

      thanks very much!

      adam
        • 1. Re: URLLoader upload progress
          2m Level 2
          With the FileReference class you can do so, but for one thing you need flash 8 to use it, and for the other I'm not sure if it will work in your case without a lot of reworking your app.
          • 2. Re: URLLoader upload progress
            adam duston Level 1
            Thanks very much for your reply, but it seems that FileReference will only work if the file exists on the user's filesystem, which it doesn't. to get the data to be uploaded i'm calling the draw method of a BitmapData object and passing it my flash.media.Video object, so the file only exists in client main memory and never on the client filesystem. I think my only option is to make RMIs from the server as the data is uploaded, causing a progress bar on the client to move along. sigh.

            i'm using flash 9, by the way. or, rather, i'm using a flex builder plugin for eclipse and coding in actionscript 3.
            • 3. Re: URLLoader upload progress
              2m Level 2
              Hi Adam,

              after posting my answer I allready had doubts about it, rethinking the camera stuff. I haven't had a lot of opportunity to look into AS3 untill now, and I'm a bit frustrated if they haven't thought about a way to adress your problem, but it might just be that Adobe is thinking Flash Media Server only in conjunction with camera.

              Just out of curiosity, as the topic turns upe once in a while here, do you (attempt to) upload the bitmat data uncompressed, or are you having an elaborate way of compressing the data?

              Markus
              • 4. Re: URLLoader upload progress
                adam duston Level 1
                Markus,

                i do compress the data, though i would hardly call the method elaborate. i instantiate a ByteArray and then pass to its writeBytes method the return value of getPixels called on my BitmapData. then i call the compress method of the ByteArray. on the server side, i decompress in java and convert to jpeg before storing in my database.

                adam
                • 5. Re: URLLoader upload progress
                  abeall Level 3
                  > Just out of curiosity, as the topic turns upe once in a while here, do you (attempt
                  > to) upload the bitmat data uncompressed, or are you having an elaborate way of
                  > compressing the data?
                  Unlike Flash 8 AS2, AS3 provides built in zlib compression:
                  http://livedocs.macromedia.com/flex/2/langref/flash/utils/ByteArray.html#compress()