NativeScript / sample-ImageUpload

An integration of nativescript-image-picker and nativescript-background-http
Apache License 2.0
22 stars 19 forks source link

It #6

Closed swinn77 closed 7 years ago

swinn77 commented 7 years ago

Where it is huploaded, I have set path like function sendImages(uri, fileUri) {

imageName = extractImageName(fileUri);

var url="http://e-ems.com/ems_app/imgupload.php?callback=&uri="+uri+"&furi="+fileUri+"&name="+imageName;

http.getJSON(url).then(function(res){

 });

var request = {
    url: "http://e-ems.com/ems_app/imgupload.php",
    method: "POST",
    headers: {
       "Content-Type": "application/octet-stream",
        "File-Name": imageName
    },
    data:"uri="+uri,
    description: "{ 'uploading': " + imageName + " }"
};

but it give still following message/ error and nothing is uploaded on my server

JS: ---------------- JS: uri: content://com.android.providers.downloads.documents/document/1 JS: fileUri: /storage/sdcard/Android/data/com.android.browser/files/Download/2016-11-22-08-57-14-267971395.jpeg JS: Image name:2016-11-22-08-57-14-267971395.jpeg JS: sanjay JS: ---------------- JS: Status: progress JS: Error: undefined JS: current bytes transfered: 4096 JS: Total bytes to transfer: 7270 JS: ---------------- JS: Status: progress JS: Error: undefined JS: current bytes transfered: 7270 JS: Total bytes to transfer: 7270 JS: ---------------- JS: Status: complete JS: Error: undefined

tsonevn commented 7 years ago

Hi @swinn77,

we have tested the sample-ImagePicker app and everything seems to work as expected. The problem in your case, could be related with the way your backend service processed the received data. The given information is not enough, to investigate further your problem. Please verify, whether your backend service processed the received data, from the mobile device.

Regards, @tsonevn