Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.