移动端将图片转成16进制,然后post到服务端(php),我用$_request['image']接受。
var_dump( $_request['image'] )是可以输出的,很大一串,但是!isset( $_request['image']和empty( $_request['image']都判断为真,并且file_put_content( $file_path, $_request['image'])函数的返回值是0。
$_request['image']的var_dump()是
这样的
回复内容: 移动端将图片转成16进制,然后post到服务端(php),我用$_request['image']接受。
var_dump( $_request['image'] )是可以输出的,很大一串,但是!isset( $_request['image']和empty( $_request['image']都判断为真,并且file_put_content( $file_path, $_request['image'])函数的返回值是0。
$_request['image']的var_dump()是
这样的
让移动端将图片二进制进行base64编码post过来。
php 处理代码
$data = $_post['image'];$bin = base64_decode($data);file_put_contents(__dir__.'/a.jpg',$bin);
试试$_files['image']呢