actavis
By:
actavis

How do I use block storage for file uploading site?

April 5, 2017 485 views
Block Storage Ubuntu 16.04

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.

Thanks!

1 Answer

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)

Have another answer? Share your knowledge.