What is the best technique to save images in the mysql database.Should I save images as blob data or save it in directories.The images will be showed every time the user visits his or her profile.
-Thanks in advance.
What is the best technique to save images in the mysql database.Should I save
Share
The best technique would be to save them in the file-system and save their paths in the database.
The database is meant for data, the file-system for files.
The technique I used in the past to make sure there are no duplicates was to hash the contents of the file and save it as the result, so I get something like:
The actual name is saved in the database. This was, the chance of having duplicates is negligible.