• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Guest
Dec 02, 2013 Dec 02, 2013

Copy link to clipboard

Copied

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?

Views

804

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 03, 2013 Dec 03, 2013

Copy link to clipboard

Copied

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....

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 03, 2013 Dec 03, 2013

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 06, 2013 Dec 06, 2013

Copy link to clipboard

Copied

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....

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 06, 2013 Dec 06, 2013

Copy link to clipboard

Copied

LATEST

This is very similar to the problem here:

http://forums.adobe.com/thread/655314

processByteArray = function(byteArrayAsPlainObject){

     // byteArrayAsPlainObject is an object serialized from a ByteArray but without functions

     // we need to get a ByteArray that we can call functions on

     var usableByteArray = new ByteArray();

     byteArrayAsPlainObject.position = 0; // make sure we start from the beginning

     ByteArray.prototype.readBytes.call(byteArrayAsPlainObject, usableByteArray);

     // now usableByteArray contains what was in the original argument, but we can actually use it on the server side

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines