开发者

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

开发者 https://www.devze.com 2023-03-06 17:34 出处:网络
I have server A that this code works on and when transferring to server 开发者_开发问答B the code does not work.

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

精彩评论

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