Hi all,
I have 2 strategies to store a photo in a db (in my example of user's image)
1. save the image into a local folder (and make it unique - say by the userID --> 2052.jpg) to access it I just point to the portrai_folder\2052.jpg
or
2. I can convert the image to bytes (do
String strDB = Base64.encode(bytes)) and store the string (strDB) in a database as field 'portrait'
Q: which one is better in terms of performance/efficiency (obviously #2 is easy to implement)
mind that images cannot exceed 15k (that is VARCHAR (20,000) )
Thanks for any pointers!