【发布时间】:2015-06-30 23:33:29
【问题描述】:
我在第一页运行此表单:
<form class="frmFrameSubmit" name="frmFrameSubmit" action="checkout.php" method="post" enctype="multipart/form-data">
<input type="file" name="inpUploadFile" class="inpUploadFile" style="display:none;" accept="image/x-png, image/gif, image/jpeg">
<input name="inpFrameWidth" class="inpFrameWidth" type="hidden" value="0">
<input name="inpFrameHeight" class="inpFrameHeight" type="hidden" value="0">
</form>
这个 php 代码在另一个页面上运行:
if(isset( $_POST['inpFrameWidth'] )) {
$aExtraInfo = getimagesize($_FILES["inpUploadFile"]["tmp_name"]);
$sImage = "data:" . $aExtraInfo["mime"] . ";base64," . base64_encode(file_get_contents($_FILES["inpUploadFile"]["tmp_name"]));
***********************************
rest of the code
***********************************
}
else{
header('Location: index.php');
exit(1);
}
它已经工作了几个星期,突然,我在 php 错误日志中收到了这个错误:
[10-Jun-2014 10:38:48] PHP Notice: Undefined index: inpUploadFile in checkout.php on line6
我尝试了什么:
正在验证 file_uploads、post_max_size 和 upload_max_filesize,但它们的值仍然不错
清除 tmp 文件; $sudo rm -rf /tmp/*
这是在使用 centos6 的开发服务器上运行的
【问题讨论】:
-
如果这工作了一段时间并且这个问题是突然引起的,它
s better contact to the server adminstrator and ask for changes . maybe theyve 更改了一些配置或更新... -
你确定它是空的吗?
var_dump($_FILES)显示array(0) { }? -
是的,var_dump($_FILES) 给了我:array(0) {}