S
S
saqo_tadevosyan2021-07-25 11:52:23
React Native
saqo_tadevosyan, 2021-07-25 11:52:23

How to send a photo to the server?

Good afternoon. You need to select an avatar and upload it to the server, I used react-native-crop-image-picker to select a photo, but after sending I get an error, everything works fine in postman, below will be the form of the file that postman sends, I need to send the same fields only with selected image, tried a lot of things and it did not work out.60fd2640459a7824155988.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Danchenko, 2021-07-25
@YahorDanchanka

Use a native FormData
object You don't even need to process the image on the client, you pass everything to the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question