V
V
Vladimir Golub2018-02-26 17:12:16
PHP
Vladimir Golub, 2018-02-26 17:12:16

What is the best way to store files for requests?

The user can create new applications in the system and attach files to them.
What is the best way to implement file storage.
1) All in the same folder, but do operations on the name.
2) Each application has its own folder (application id its name)
3) Either folders by dates and already switch to names
The best option I think is 2. But there are user problems, the folder needs to be created as soon as the user enters the application page. If he closed it, delete the folder and record in the database. Or first upload the files to a temporary folder, and then transfer them to the application folder?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Viktor Yanyshev, 2018-02-26
@RazerVG

Why create a directory before it's needed? Can't you just create a directory if $_FILES is not empty?
In the php doc, see move_uploaded_file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question