Skip to content

Problem to send file #25

Open
Open
@njtnestor

Description

@njtnestor

Hello I am using a Mediafilepicker to grab a file with nativescript, but as example to test I created a file of next way:

let stream = new java.io.ByteArrayOutputStream();
stream.write(5)
let file = stream.toByteArray()

After i do this:

let fd = new TNSHttpFormData();
let params = []
let param = {
     data: file,
     parameterName: 'file'
}
params.push(param)
try{
       const response = await fd.post('https://example.com/file', params, {
         headers: {
            //some headers
         }
       });
            console.log(response)
} catch(e){
     console.log('error:', e)
}

As result I got my app blocked and crashed without errors

P.D: I'm using javascript instead typescript

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions