解决方法
如果你启用了
allow-url-fopen
,它实际上非常简单. PHP支持数据:URL方案,然后自动解码base64和urlencoding.
- preg_match('#^data:[\w/]+(;[\w=]+)*,[\w+/=%]+$#',$data=$_POST["dataU"])
- and
- copy($data,"output.png");
但你也可以在之后提取零件,并手动base64_decode()
.