Answer the question
In order to leave comments, you need to log in
How and where is it better to store documents on the site?
The task was to upload documents to the site for user verification. What is the best way to load and store them in the future without leaks? The server side of the site in PHP. Share your tips or tutorials.
Answer the question
In order to leave comments, you need to log in
1) create a folder for documents outside the public folder (the one in which index.php and statics)
2) create an action to download files, place these files there, bind the file to the user at the database level
3) return the file for viewing should be done only through the action (so that there is no direct access to the file using the url selection method), with a check that only the user and admins can view it
uploading documents to the site for verification
I think it's better to create a separate project to store your documents and unload from it. But this is not the exact correct answer.
Look towards object storage such as Minio (compatible with AWS S3). Deploy it on your server and store it there. It will be more hopeful than just storing it in a folder as suggested in the messages above.
I saw a similar example when AWS taught. The document was loaded directly into S3 using a token from a web server. Without a token, no one has any access. Something like this.
How strange! Everyone read the question and no one even noticed!
the task was to upload documents to the site for user verificationYou have an extremely difficult task! )))
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question