Jump to content

Where to store images?


ds111

Recommended Posts

Hello,

 

  I am building a website and I expect around 10,000 users. Throughout the website, I allow users to upload images (up to 50 images/user) for various purposes. The problem I am facing is how to store the image? Should I save the encoding of the image in MySQL, or should I have a separate directory for each user and store the path in MySQL?

 

Which would be the most efficient, and why?

 

Thank you very much for your help.

Link to comment
https://forums.phpfreaks.com/topic/166363-where-to-store-images/
Share on other sites

I created a gallery myself and the structure I used was to have an albums directory where you have a directory for each album created.

 

The only downfall is that no two albums can have the same name, so you would have the same thing to consider where no two users could have the same user name.

 

How you store them ultimately is up to you in what you feel would meet your needs the best.

 

The one other thing to keep in mind is that with Linux you do have a max links value for the OS meaning you can only have so many files in one directory.  The number is something ridiculous though so likely not a problem you'd run into.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.