Php 文件\u get\u contents()未执行此操作

Php 文件\u get\u contents()未执行此操作,php,file,image,Php,File,Image,我有以下几点 $name = basename($_FILES['the_file']['name']); $size = $_FILES['the_file']['size']; $contents = $_FILES['the_file']['tmp_name']; if($size <= 5242880 && is_uploaded_file($_FILES['the_file']['tmp_name'])) { $picture = file_get_co

我有以下几点

$name = basename($_FILES['the_file']['name']);
$size = $_FILES['the_file']['size'];
$contents = $_FILES['the_file']['tmp_name'];

if($size <= 5242880 && is_uploaded_file($_FILES['the_file']['tmp_name'])) {
    $picture = file_get_contents($contents);
    echo $picture;
}
$name=basename($_文件['the_文件']['name']);
$size=$\u文件['the\u文件]['size'];
$contents=$\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\;

如果($size可能您在表单中遗漏了
enctype

<form action='...' method='POST' enctype='multipart/form-data'>


您是否检查了对echo$picture的调用是否正在执行?将其更改为echo“#”。$picture.#”很快就会告诉您,因为如果执行得太远,您会得到一对哈希。奇怪的是……它似乎没有执行
if
块..:(您是否检查过允许PHP脚本实际占用您允许图片占用的5MB内存?是的,5MB是我的限制,但这不重要:文件是700KAh,垃圾。这就是问题所在。非常简单。\ ux。谢谢。
<form action='...' method='POST' enctype='multipart/form-data'>