I am currently developing a website that allows uploading of images and other files. At this point I have a couple of doubts.
The first is, where should those files be stored? I was thinking of storing them in the file system.
And the second, what is the most correct way to serve uploaded multimedia files? If you use the file system as a storage medium, should you use static routes configured on the server or is there another better alternative?
Where should the files be stored?
If the numbers of files are limited and not very much, then you can store it in the filesystem. However, if the number is large, I would recommend to store it in some storage service like AWS S3. Process could be either of two that you store temporarily the uploaded file in filesystem and then upload it in S3 or direct upload to S3. Depends on the use case.
What is the most correct way to serve uploaded multimedia files?
In case you are using services like S3, you just have to set content type and expiration among other metadata while uploading and rest everything will be taken care by S3 only. In case you are storing data on filesystem, then you can use nginx/apache to serve the static assets files along with proper content type and other metadata.