【发布时间】:2019-06-19 19:43:14
【问题描述】:
我想知道如何对在 APOST 表单上从一个页面发送到另一个页面的文件进行 base64 编码。
因为,这不起作用base64_encode($_FILES['file'])
甚至base64_encode(file_get_contents($_FILES['file']))。
甚至base64_encode(file_get_contents($_FILES['file']['name']))。
他们为什么不工作。正确的做法是什么。
【问题讨论】:
-
$_FILES['file'] 不正确 - php.net/manual/en/features.file-upload.post-method.php
-
为什么要编码?您不想对编码传输进行解码吗?
-
@Quasimodo'sclone 检查上传的文件是否与数据库中已有的任何其他文件匹配
-
@Quasimodo'sclone 我不明白
-
您应该查看
$_FILES['file']['tmp_name']假设您的表单字段名为“文件”
标签: php file file-upload