Image *

How do I load an image in React JS?

<div className="mb-1">
     Image <span className="font-css top">*</span>
     <div className="">
         <input type="file" id="file-input" name="ImageStyle"/>
     </div>
</div>
      

Run codeHide result


This is a snippet I provided that I used to select a file from device in js command.With this I can select a file and this filename is also shown Now I want to save this file to S3 or anywhere and get its url- address from there and send it to your server using fetch api call.

+3


source to share


2 answers


You can follow this link to get the url of the image loaded into firebase storage when selected from your local directory. This is for reaction



+2


source


If you want to upload an image and send it to API. Then you install react-image-uploader

. It stores the image on the local port as well as in your database by triggering a POST request.



0


source







All Articles