1
我試圖將base64圖像上傳到服務器。 我已經嘗試了很多答案,但我總是得到相同的錯誤。Laravel 4 - 反序列化():在保存base64圖像時偏移時出錯
鏈接,我試圖
How to save a PNG image server-side, from a base64 data string
https://www.reddit.com/r/laravel/comments/39wclp/how_to_convert_an_base64_image_string_to_an_image/
Convert Base64 string to an image file?
下面這段代碼應該工作。
$image = base64_decode(Input::get('image_cropped'));
$image_name= 'file_name.png';
$path = public_path() . "/images/" . $image_name;
file_put_contents($path, $image);
向我們展示失敗的base64編碼PNG圖像的示例。 'unserialize()'也不解碼base64編碼的字符串。 –
base64 png圖片非常大。 –
此錯誤與您的圖像創建無關。你寫會議商店的東西。它的laravel框架會話存儲處理程序相關。 – di3