I am currently attempting to upload an image that I captured with Nativescript to a server using a web API that I created in C# (ASP.NET). The API works perfectly fine when tested on Postman, but I encounter an error "Error During Upload" while trying to upload from my android device.
Here is the code for the web API:
[HttpPost]
[Route("PostUserImage")]
[AllowAnonymous]
public async Task<HttpResponseMessage> PostUserImage()
{
// Code goes here
}
And this is the code for the Nativescript upload:
// Nativescript upload code goes here
Output
JS: Result is an image asset instance
JS: Image taken!
JS: file path;;;;;;:/storage/emulated/0/Pictures/Test.jpeg
JS: in dock receive
JS: ----------------
JS: Status: progress
JS: current bytes transfered: 4096
JS: Total bytes to transfer: 92558
JS:----------------
JS: Status: progress
JS: current bytes transfered: 92558
JS: Total bytes to transfer: 92558
JS: ----------------
JS: Status: complete