I am developing a app where i need to upload an image to the server. Based on the image i get a response which i need to render?.
Can you please help me how to uploa
My solution is using fetch API and FormData.
Tested on Android.
const file = { uri, // e.g. 'file:///path/to/file/image123.jpg' name, // e.g. 'image123.jpg', type // e.g. 'image/jpg' } const body = new FormData() body.append('file', file) fetch(url, { method: 'POST', body })