Results 1 to 4 of 4

Thread: Need to Generate Blob data from the Base64 encoded image string data

  1. #1

    Default Need to Generate Blob data from the Base64 encoded image string data

    Hi,

    I am working with sencha-touch 2 commercial version and phonegap 1.5.

    I am capturing image from camera and gallery with base64 image data that is fine.

    Now, I need to upload that image to amazon s3 server for that I need to convert this image into encoded blob data format. I am able to convert that fine with browser but not from android device.

    I want to use this,

    Code:
    var uInt8Array = new Uint8Array(rawLength);
    or
    var uInt8Array = new Int8Array(rawLength);
    or
    var ab = new ArrayBuffer(bytes);
    but all array type giving error for undefined.

    So, how should I achieve such functionality using ST and Phonegap.

    Any Ideas?

    Thanks in Advance.

  2. #2
    Sencha User
    Join Date
    Sep 2008
    Posts
    22

    Default

    Can you post the code you are using to post the base64 encoded image data to the server?

  3. #3

    Default

    Here is the code which is used to post imagedata to server that is base 64 encoded which amazon server is not supported.

    So, I need to convert that data into BLOB data format.


    Code:
    formData.append("file", imagedata, "test.png");
    var xhr = new XMLHttpRequest();
    xhr.open("POST", SERVER_URL, true);  
    		xhr.send(formData);

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Posts
    47
    Answers
    5

    Default

    i use FileTransfer.
    Just change the Cam Options to FileURI, the use FileTransfer and send it to your server.

    http://docs.phonegap.com/en/1.5.0/ph...l#FileTransfer


    the rest aim doing on my server, sending to amazon too.

    On the Server you can use with PHP $_FILES

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •