I have a React app + express hosted in a Droplet. I want to allow my users to upload some pictures, save this pictures in my droplet and get a sort of reference to be able to show this picture where I want.
For example a user wants to write a news article, they upload a picture to show in the article… and then once the user upload the picture, from the JAVASCRIPT point of view…, how can I save this picture from my react front end to digital ocean? and then how can I get back a reference of that image to show it in the news article?
Thanks
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Sign up for Infrastructure as a Newsletter.
Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Hey friend,
Great question. I found a tutorial that may be helpful:
https://codeburst.io/react-image-upload-with-kittens-cc96430eaece
For your purposes, it may help matters to consider this not specific to DigitalOcean. For example, this question:
“how can I save this picture from my react front end to digital ocean”
Would be better phrased as:
“how can I save this picture from my react front end to a Linux file system”
This extracts specific detail and replaces it with the generic one, because while the problem may have been solved in the generic fashion, there may be less information available about it that specifies DigitalOcean (which, in this case, is an interchangeable variable of no consequence).
Hope that helps :)
Jarland