包含文件时,POST数组为空 [英] POST array is empty when containing a file

查看:145
本文介绍了包含文件时,POST数组为空的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含文件输入的简单HTML表单。当表单没有提交文件时,打印 $ _ POST 数组显示所有提交的数据。然而,在提交文件时, $ _ POST 不会打印出任何提交的数据。

I have a simple HTML form containing a file input. When the form is submitted without a file, printing the $_POST array shows me all of the data submitted. When a file is submitted, however, $_POST doesn't print out any of the submitted data.

可以有人告诉我为什么?这是我的代码:

Can somebody tell me why? This is my code:

<?php
    print_r($_POST);
?>
<form action="test.php" method="post" enctype="multipart/form-data">
    <label for="myfile">Video File:</label>
    <input type="file" name="myfile" />
    <br /><br />
    <label for="mytitle">Title:</label><br />
    <input type="text" name="mytitle" size="55" maxlength="60" />
    <br /><br />
    <input type="submit" name="mysubmit" value="Submit Video for Approval" />
</form>


推荐答案

您的脚本看起来很好。请检查您的服务器配置。也许你超过POST的限制(在php.ini中用post_max_size设置)

Your script seems fine. Please check your server configuration. Perhaps you exceed POST limits (set with post_max_size in php.ini)

这篇关于包含文件时,POST数组为空的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆