file_get_content服务器对服务器二进制文件上传

1、file_get_contents函数可安全用于二进制对象,适用服务器对服务器文件是上传场景

base64_encode(file_get_contents('1268879774AaCl4wIE.jpg', true))

需要做base64编码,必要情况下还需要用文件特定函数如图片,resize函数验证文件内容是否包含html/php等代码。

2、form表单multipart/form-data适用客户端对服务器文件上传

猜你喜欢

转载自www.cnblogs.com/hnhycnlc888/p/10000229.html