Read image upload response

Im using this code to upload images: https://github.com/NativeScript/sample-ImageUpload

When I upload the image, I received a notification of success. I am trying to read the response from the server, and also checked the task completion event:

task.on("complete", logEvent); function logEvent(e) { console.log(JSON.stringify(e)); } 

and this is the result:

 {"eventName":"complete","object":{"_observers":{"complete":[{}],"propertyChange":[{}]},"_session":{"_id":"image-upload"},"_id":"image-upload{1}","_description":"{ 'uploading': Test0.png }","_upload":3807297,"_totalUpload":3807297,"_status":"complete"},"response":{}} 

as you can see, the answer is null. So how can I read the response from the server?

+5
source share
1 answer

the data tells you why it is null? it does not end for download only in the session. look here in the image sending function what you need to do.

0
source

Source: https://habr.com/ru/post/1269864/


All Articles