php - 请帮助:如果 isset 在上传多个文件时不起作用
问题描述
我尝试上传多个文件我使用了很多脚本来上传它工作正常但有时有些文件没有上传我检查了问题
当我选择所有图像时,我有一个包含图像的文件单击提交时我没有得到任何响应
当我选择所有文件时,我只想让它说(嗨),这样我就可以知道它在上传时到达了我的代码。
<?php /* and also checked by : */
if (isset($_POST['btnsubmit'])) {
echo "hi";
}
/* it's not working when i select all the images in once and click submit to check */
if(isset($_FILES['files']['name'])) {
echo "Hii";
} // it's not working when i select all the files
?>
<html>
<head></head>
<body>
<form id="myForm" name="myForm" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post"
enctype="multipart/form-data" >
<table width="100%">
<tr>
<td>Select Photo (one or multiple):</td>
<td><input type="file" accept="image/gif, image/jpeg, image/png" name="files[]"
multiple="multiple" required /></td>
</tr>
<tr>
<td colspan="2" align="center">Note: Supported image format: .jpeg, .jpg, .png, .gif</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" name="btnsubmit"
value="Submit" id="btnsubmit"/></td>
</tr>
</table>
</form>
</body>
</html>
解决方案
通过添加解决了
exit;
到 php 代码。
不管怎么说,还是要谢谢你 。
推荐阅读
- python - Python3 比较运算符
- laravel - laravel-7 elequent 集合合并不起作用
- java - 使用 HashSet 的复数
- typescript - 打字稿,类型“从不”可以分配给每种类型
- flutter - Flutter,防止Text自动换行
- json - TypeError:(中间值).toDate 不是函数
- bar-chart - Python Seaborn Pandas 条形图问题 - 不同州的相同年份
- r - 在闪亮的应用程序中创建具有动态组数的按图分组的条形图
- angularjs - 如何将 Prisma 与 Electron 一起使用
- swift - 将 createColdObservable 用于 RxTest 时 XCTAssertEqual 失败