PHP file uploading headache

heyboy007

New Member
I am having a tough time trying to upload files through PHP.My form:\[code\]<form action="blah.php" enctype="multipart/form-data" method="post"><p> Upload file: <input type="file" name="xmlfile"/><input type="submit" name="upload_submit" value="http://stackoverflow.com/questions/3933766/Upload" /> </p></form>\[/code\]Checklist:
  • No 'smart' quotes in sight. Fine.
  • Proper enctype. Fine.
  • name attrib in input tag. Fine.
  • My \[code\]/tmp\[/code\] directory has the following permissions: \[code\]drwxrwxrwt\[/code\]. Fine.
  • post_max_size = 50M, upload_max_filesize = 50M, file_uploads = On. Fine.
\[code\]print_r($_FILES)\[/code\] gives \[code\]Array()\[/code\]. Useless. Tried on images, xml files, etc. Nothing works.What I don't understand even further is that there are pages on which file uploading works on the same server. The only thing different from what I can gather is that the page I am working on has a few other forms which aren't of \[code\]enctype="multipart/form-data"\[/code\]. Should this matter?PHP code as requested:\[code\]if($_SERVER['REQUEST_METHOD'] == 'POST'){ if(isset($_POST['upload_submit'])){ print_r($_FILES); exit(); ... }}\[/code\]Gives an empty array regardless of \[code\]print_r\[/code\]'s position; I also tried it right after the \[code\]if($_SERVER['REQUEST_METHOD'] == 'POST'){\[/code\]
 
Back
Top