使用顫振將圖像作為blob存儲在mysql數據庫中 (Storing image's as blob in mysql database with flutter)


問題描述

使用顫振將圖像作為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 pashaidobarabi)

參考文件

  1. Storing image's as blob in mysql database with flutter (CC BY‑SA 2.5/3.0/4.0)

#blob #dart #MySQL #PHP #Flutter






相關問題

Hibernate:如何設置自定義 UserType 的值 (Hibernate: How to set the value of a custom UserType)

從數據庫中讀取 zip 存檔 (Reading zip archive from database)

從 JSON 網絡服務檢索 android 中的 byte[] (Retrieve byte[] in android from JSON webservice)

ORA-01465: 使用 BLOB 時,oracle 中的十六進制數無效 (ORA-01465: invalid hex number in oracle while using BLOB)

無法使用 fopen/fwrite/fclose (php) 在 mysql 中保存 xml 文件內容 (Can't save xml file content in mysql with fopen/fwrite/fclose (php))

將 Azure Blob 中的數據流式傳輸回客戶端 (Streaming Data from Azure Blobs Back to Client)

我希望將畫布保存為 mySql blob 字段中的 blob (I am looking to save a canvas as a blob in mySql blob field)

如何在 SQLite 中分段更新 blob? (How to update piecewise a blob in SQLite?)

YugabyteDB 中是否像 Oracle 或 Postgres 那樣支持 BLOB? (Is there support for BLOBs in YugabyteDB like in Oracle or Postgres?)

使用顫振將圖像作為blob存儲在mysql數據庫中 (Storing image's as blob in mysql database with flutter)

如何從 docxtemplater.js 輸出 docx 以在 jszip 中輸入 (How can I output a docx from docxtemplater.js for input in jszip)

不同語言的 Blob 請求 (Blob request in different language)







留言討論