Phonegap / Cordova File Transfer Upload Image as Base64 String not working in ios

I am working on loading image as base64 image stream from phonegap / cordova app, it works fine on android but doesn't work in ios, however in ios it works when the image is png / jpg but when it's base64 the image stream its not working please someone can help me with the same.

Here is my code for the same,

var options = new FileUploadOptions();
    options.fileKey = "file";   
    options.fileName = "test.jpg";
    options.mimeType = "image/jpeg";    
    options.chunkedMode = false;

     options.params = {
                "key": "test.jpg",
                "AWSAccessKeyId": awsKey,
                "acl": acl,
                "policy": policyBase64,
                "signature": signature,
                "Content-Type": ""
            };

    var ft = new FileTransfer();
    ft.upload(imageURI, s3URI + "",
            win, fail, options);
}
function win(r) {
    console.log("Code = " + r.responseCode);
    console.log("Response = " + r.response);
    console.log("Sent = " + r.bytesSent);
    alert(r.response);
}
function fail(error) {
    alert("An error has occurred: Code = " + error.code);
}

      

+3


source to share


3 answers


Version 1.5.0 of the file transfer plugin has already added this functionality. The patch was applied on December 14, 2015.

You can see the commit here .



Updating the plugin solved the problem in my case at least.

+1


source


Set chunkMode true when using base64 to boot with a phone splash



0


source


I set chunkMode to true, but the file still doesn't get transferred to the server. It looks like the cordova file transfer plugin does not support base64 image to load on iOS.

0


source







All Articles