How do I use block storage for file uploading site?

Hey DigitalOcean,

I’ve been reading your tutorials for a while now and since you’ve been so helpful I decided to pay for a SSD cloud server with block storage. I uploaded my source for my file hosting site and everything works. However, what I want to do is when someone comes on my site and uploads their file I want the file to be stored on my block storage. I configured my volume but I’m confused on how to use my block storage for incoming files.



Submit an 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.

Hi @actavis You have several options.

  1. Change the path of the upload folder in the configuration of you web app.
  2. Mount the volume with a direct path to the upload directory.
  3. Create a symlink pointing from the upload path to the block volume.

I’ve probably missed other options, but in general you have a lot of options, so it depends on what you like the most (depending on your web app)

I have tried all options but not able to upload media on block storage. Getting an error Invalid path to upload image. Please help