B
B
bravooo2021-05-05 12:19:10
API
bravooo, 2021-05-05 12:19:10

API service for uploading (saving) files to the server?

A little stuck on one task, there is an old program that stores all the information in the database, the main problem is that most of the database is pictures, the idea arose to separate its file part from the application. API service (I use python + flask) for receiving and returning images by guid, it’s not a problem, I thought to do it this way, get an image, generate and write to the guide database, save the image to the appropriate section using the FTP raised on the same server, but while I was thinking about it, the idea arose not to use ftp, but to write using the web application to the appropriate directory .. Studying the question, I didn’t find any clear answer (maybe I’m not looking quite right), maybe you have encountered such tasks, could you help me in which direction to look, which approach is more correct (rather in terms of storage / file location)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Romses Panagiotis, 2021-05-05
@romesses

For distribution of files it is better to use Nginx, Varnish and other solutions.
It is enough to extract the files from the database and put them in a folder for delivery by the web server. You can also name files with a GUID.
Alternatively, transfer files to an S3-compatible storage such as MinIO or the cloud.
FTP is an obsolete protocol and is being phased out. It is customary to use HTTP/2 to distribute files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question