把base64l讓PHP存成實體檔案
$data = 'data:image/png;base64,AAAFBfj42Pj4' ; list ( $type , $data ) = explode ( ';' , $data ); list (, $data ) = explode ( ',' , $data ); $data = base64_decode ( $data ); file_put_contents ( '/tmp/image.png' , $data ); 資料來源 http://stackoverflow.com/questions/18230573/dataurl-to-image-for-download-in-php