后台是用php写的
代码如下所示,其实就是base64格式图片的存储
$data=$_REQUEST;
if($data['first_image'])
{
if(preg_match('/data:\s*image\/(\w+);base64,/iu',$data['first_image'],$tmp)){
$img = str_replace(' ','+',$data['first_image']);
$img = str_replace($tmp[0], '', $img);
$img = base64_decode($img);
$path= './videos/img/';
$file = $path.md5(time().rand(1000,9000)).'.'.$tmp[1];
if( file_put_contents($file,$img))
{
$data['first_image']=substr($file, 1);
}
}
}