There is a section in my application where I need to take photos from users and post them to the server with rest api. ı take photos by users from camera or select gallery. After taking photos, I keep and access by path in redux array. But when posting to server I need to discard photo, not the path. How can I do that? Please help me.
Asked
Active
Viewed 226 times
1 Answers
0
The image URI path returned by the image picker package is a reference of image data on device memory but doesn't contain actual data.
Your remote server API should either support image data as BLOB or base64. Most of image pickers return also base64 data for image. You should upload base64 data.

Fiston Emmanuel
- 4,242
- 1
- 8
- 14
-
Server supports base64. But I don't know where I start with image picker. Thanks anyway! – ttars Oct 03 '22 at 06:03
-
This package has base64 support - https://github.com/react-native-image-picker/react-native-image-picker – Fiston Emmanuel Oct 03 '22 at 13:29