問題描述
使用顫振將圖像作為blob存儲在mysql數據庫中 (Storing image's as blob in mysql database with flutter)
將blob圖像存儲在mysql數據庫中並使用php在flutter應用程序中獲取它們是否很好,或者我應該將它們存儲在一個單獨的文件夾中,並將它們的鏈接存儲在數據庫中?對於具有超過 100K 圖像的數據庫,什麼是更好的解決方案。我認為在備份時存儲圖像路徑會很困難。有人可以建議做什麼。這將非常有幫助。提前謝謝!
參考解法
方法 1:
The best practice is to store the images in a folder and just save their path's in the database. So basically convert the images to base64 and send it to your webserver in a regular POST method. then in your PHP code decode the base64 to a file and save the image wherever you want, just remember to keep track of the image new path so can fetch it later. fetching, by the way, works the same. good luck :)
(by saajid pasha、idobarabi)