Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andriod: Get error response code 1 when trying to record and upload bigger then 30MB #254

Open
Ghits-nl opened this issue Oct 29, 2019 · 0 comments

Comments

@Ghits-nl
Copy link

Ghits-nl commented Oct 29, 2019

I am getting de responseCode 1 on error.
code:
global.SendDoc = function(ScanBuffer,ZAsessieid)
{
var SendDoc = ScanBuffer[0];
console.log( "er zijn " + ScanBuffer.length + " docs to send");

var docsdone = scancounter - ScanBuffer.length;
MaxProgress += ProgStep; //doc ophoging 1
getScanFromID(SendDoc)
.then( row => { 
   var BestandPad =row[0][4];
   var fileName = FileRename( row[0][3], ZAsessieid) ;  // 
   log("sending " + fileName ,3);

    var session = bghttp.session("image-upload");
    var request = 
    {
        url: klanturl+ "/FileUploader.asmx/UploadScan",
        method: "POST",
        headers: 
        {
            "Content-Type": "application/octet-stream",
            "File-Name": fileName,
            "AUTHCOOKIE": token,
        },
        description: "{ 'uploading': '" + fileName + "' }"
    };
    var task = session.uploadFile( BestandPad, request); 
    task.on("error", uploadfail);
    task.on("complete", uploadsuccess);   
    
})
.catch( error =>
{       KillSending( "error  : ( " + error + " ) ");   
});  

}
//////////////////

function uploadfail (error)
{
//Getting 1 here
console.log("Fout bij upload. response code --------------------------"+ error.responseCode);
//Getting NULL here
console.log("Fout bij upload. response code --------------------------"+ error.response);
log("uploadfail 1 : " + "Error Upload ", 2);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant