Skip to main content
December 3, 2013
Question

How to pass an image from the mobile application to the Adobe Media Server?

  • December 3, 2013
  • 1 reply
  • 894 views

The image is taken as photo from the CameraUI in the Client Side(AIR Mobile Application) and saved as a .jpg file in the mobile. I passed the image byte array values from the client to the server. How to convert that byte array to a file in the Adobe Media server?

This topic has been closed for replies.

1 reply

December 3, 2013

You can use File class to write bytearray to a file. For more details about the same, check the following link:

http://help.adobe.com/en_US/adobemediaserver/ssaslr/WS5b3ccc516d4fbf351e63e3d11a11afc95e-7eacSSASLR.2.3.html

December 4, 2013

private function imageLoading():void

                              {

                                        var req:URLRequest = new URLRequest(image file url path);

                                        var urlLoader:URLLoader = new URLLoader(req);

 

                                        urlLoader.addEventListener(Event.COMPLETE, onURLLoaderComplete);

                                        urlLoader.dataFormat = URLLoaderDataFormat.BINARY;

                                        urlLoader.load(req);

                              }

 

                              private function onURLLoaderComplete(event:Event):void

                              {

  imageByteArray = event.target.data;

                              }

This imageByteArray is passed to the Server. Server received this bytearray as an Object. How to get the raw  bytearray data from this object in Server side?

December 6, 2013

You can use NetConnection.call method and pass ByteArray as one of the arguments. For more details about NetConnection.call(), check the link http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetConnection.html#call()

Also, In the server side you can create a ByteArray object and call ByteArray.writeBytes() method to write the data to server side ByteArray or else you can directly write the ByteArray to a file in binary mode. For more details about ByteArray class see:

http://help.adobe.com/en_US/adobemediaserver/ssaslr/WS37cb61f8f3397d86-59ed32111288f0b936c-8000.2.3.html

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html