I want to create an image upload for users to upload a profile picture and be able to resize it. However, I was wondering how should I do the database table. I think I should have a field for user id, and image name, but then there would obviously be collisions which led me thinking about hash tables which seems like a overkill, so I thought I’ll ask here hoping someone who is more knowledgable could give me some ideas.
I am using Zend Framework, for your information.
This is may not be an exact answer for your question. However, it can be an advice.
If you want to keep the images or files in database, you have to maintain many things. There are a lot of discussion which you can search in google by “images in database or folders”
I would recommend you to keep the images in folders instead of in database. So, in your database you just have to keep only ‘path’ to images as a column.
In other words, your USERS table can have a column as:
instead of keeping the whole image as
The advantages for this solution are:
The disadvantages for this solution are:
You can read more detail in google.