How should I save a base64 image to server? I don't want to lose the resolution when next time user retrieve it. Just save the data object and it will be fine?
Asked
Active
Viewed 139 times
1 Answers
0
You might get some arguments about storing images in the database, rather than a in separate folder and storing a link in the database. But if you do want to store the image in the database then you can use a BLOB field. There are some examples in the following links :
http://www.anyexample.com/programming/php/php_mysql_example__image_gallery_(blob_storage).xml
Insert Blobs in MySql databases with php
http://www.mysqltutorial.org/php-mysql-blob/
-
where does the image goes physically? storing media file in db is old, it's pricey and unable to scale. – Nichole A. Miler Jan 05 '16 at 15:11
-
The physical location is dependant on storage engine (& MySQL version). There is some more info on the pros & cons of using BLOBS here : http://stackoverflow.com/questions/5285857/when-is-using-mysql-blob-recommended & MySQL docs here : http://dev.mysql.com/doc/refman/5.7/en/storage-requirements.html – PaulF Jan 05 '16 at 15:25