图片转换为base64,通过post传输后‘+’会变成 ‘空格’, 须要用PHP 处理一下 post
$str= $_POST['img_data']; $str= str_replace(' ','+',$str); file_put_contents('./test.png',base64_decode($str));