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 upload an image using react-native?.
Right-click the folder and select “Upload other file here. . .“. Browse the server for the file you want to upload. Select the file and click Open. Now, you will see the file in the folder location on the server.
There is file uploading built into React Native.
Example from React Native code:
var photo = { uri: uriFromCameraRoll, type: 'image/jpeg', name: 'photo.jpg', }; var body = new FormData(); body.append('authToken', 'secret'); body.append('photo', photo); body.append('title', 'A beautiful photo!'); var xhr = new XMLHttpRequest(); xhr.open('POST', serverURL); xhr.send(body);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With