How to Upload File/Image to Server with Form Data in React Native

preview_player
Показать описание


Create FormData by creating an object and appending the values you want to send to the server
const data = new FormData();

#formdata #reactnative #android #imageuploading
Рекомендации по теме
Комментарии
Автор

Thank you!! You saved me from a three-day struggle.🔥🔥🔥

orkhannabiev
Автор

Thanks, when a user upload files the first process to create file with user display name and then upload images? Can u help on this

omaralaufi
Автор

what you do in the api {STAGE_URL}/user/upload/image to make an public url for the photo from the formData that we sent in the request?

yuval_silver
Автор

hy your tutorial is very help full
I am using reanimated2, that's why I have to use flipper debugger please make a tutorial

imrankhan-fnne
Автор

You mentioned to stringify object when sending data but you are sending object without stringifying and it still works. How?

sushmarodrick
Автор

When I choose mediaType: 'video', the video folder in my gallery apppears for a second and then disappear.
so i am not able to choose videos.
please help.

karandeepsingh
Автор

Hey there.
And how do you access it in the frontend? Like for example: a guy uploads his avatar and it should all be fetched in the rendering, how do I send him the image? through the generated image link or the image's bytes?

sagivalia
Автор

Hi sir, I want to send my sign up user data with the image in the same call, How can i do this ? I send my user info using body raw JSON, but i want to send the image, I can send all in the form-data?

js
Автор

what should i do when i want to upload blob as form data?? becuase reactnative get network error when i append blob to form data🤔🤔 do you have any solution?!!

mohammadrezadehghani
Автор

Am facing an error from the fetch function "Network failed... how should i resolve this"

ezra
Автор

Could you show the backend api code too so we know how the image is being handled?

reznov
Автор

how to upload another data including image in form data

jyotish
Автор

How reject selected file before upload ?

santhoshpanjalavlogs
Автор

How to apply flipper in usb connected device ?

aviseksahoo
Автор

I have question while uploading image and file using document picker using form data i got a network error sometimes and sometimes I am not getting this error in Android itz working fine in ios

Zero-qcnu
Автор

How to Upload File/Image to PHP Server in React Native, please explain or create a video on this topic.

ArjunYadav-npfh
Автор

I am following same process but image not updating
But on postman its working fine


Here is code for laravel backend api
if ($request->hasFile('img'))
{
$img =
$request->img->move(public_path('uploads/users'), $img);
$input['img'] = $img;
}
Is this compatible with our method


Please tell me know how i can solve it

mantritech
Автор

how to retrieve it and show in react-native

aqibabbasi
Автор

i just do one mistake but now I did it "("Content-Type", 'multipart/form-data')" its important

arsalanahmed
Автор

possible unhandled promise rejection esi error aa rahi h

hitul