Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Is it ok to have a folder for each uploaded file on disc?

0 votes
241 views
asked Nov 17, 2014 in Q2A Core by vdamanafshan
edited Nov 18, 2014 by vdamanafshan
As you know it's possible to store uploaded files on disc rather than the database. The only issue is that each uploaded file is stored in a separate folder on disc.

Doesn't this behavior get my site into trouble while the site receives more files to upload monthly?
Q2A version: 1.6.3

1 Answer

+1 vote
answered Nov 17, 2014 by pupi1985
selected Nov 18, 2014 by vdamanafshan
 
Best answer
...each uploaded file is stored in a separate folder on disc
Not really. File ids that share the same first 3 digits are stored in the same directory. That helps reduce the amount of files per directory. The more files you have the more chance you'll have that 2 or more files fit in the same directory.
 
Here is the function responsible of performing the file distribution so: https://github.com/q2a/question2answer/blob/master/qa-include/app/blobs.php#L40
commented Nov 18, 2014 by vdamanafshan
@pupi1985: Thanks for your good news! I didn't know it.
Could you please answer my question as well?
>Doesn't this behavior get my site into trouble while the site receives more files to upload monthly?
commented Nov 18, 2014 by pupi1985
Definitely not. This works this way in order not to get your site into trouble when files get uploaded
commented Nov 18, 2014 by vdamanafshan
@pupi1985: Thanks for your answer. Marked your answer as best answer.
...