Question

How upload images or pdf file in my droplet storage?

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

Show comments

Submit an answer


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!

Sign In or Sign Up to Answer

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.

jarland
DigitalOcean Employee
DigitalOcean Employee badge
December 28, 2018
Accepted Answer

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

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel