开发者

Trying to upload file, php, and getting an empty array

I have server A that this code works on and when transferring to server 开发者_开发问答B the code does not work.

I am trying to upload a file using PHP and once I hit submit the $_FILES array is empty. I can see the file being sent the through $_POST array, but nothing in the $_FILES array. I am pulling my hair out and cannot find an answer. What would be the answer?


Sure, you have not a enctype definition.

if in your html form yo have:

<form method="post" action="file.php">

change for:

<form method="post" action="file.php" enctype="multipart/form-data">

Other pronlem, has be the upload_max_filesize in your php.ini, check that, or try:

ini_set('upload_max_filesize','512M'); 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜