1
我遇到麻煩使用Jquery文件上傳引導皮膚(https://github.com/blueimp/jQuery-File-Upload)。該程序本身工作得很好,即使在github(https://github.com/blueimp/jQuery-File-Upload/wiki/Working-with-databases)上描述的數據庫也是功能性的。jquery文件上傳到base64數據庫
但我真正需要的是將圖片以base64格式保存在數據庫中。我似乎無法得到它。所以在add_img函數中,我需要以某種方式獲取base64中的圖片。
// Standard file uploader code
function add_img($img_name)
{
$add_to_db = $this->query("INSERT INTO pics (pic_name, pic) VALUES ('".$img_name."','picture in base64 here')");
return $add_to_db;
}
這部分我確實媒體鏈接發現。我只是不知道這些數據在文件中的可用位置。因爲在某些時候它必須製作實際的圖片(imagedata),但我看不到在哪裏。 – Matt 2013-04-06 17:11:50
$ imagedata = file_get_contents($ file_path); – 2013-04-06 17:57:12
我看到你在那裏做了什麼。它的工作原理,謝謝! – Matt 2013-04-06 19:13:13