Hi everyone!
I have legacy code that I'm trying to fix on a server running PHP 4.3.1. Below I have pasted some of the code I borrowed from another post in my attemt to solve this problem.
On my personal webserver, all runs a-ok... $_FILES['fupload'] contains the file information and where it is stored in tmp after upload. (PHP4.3.1/file_uploads=On)
However, on my server at work (same config as above), $FILES['fupload'] doesn't exist... $POST['MAX_FILE_SIZE'] comes through fine after submittal, but it seems like even with PHP.ini's file_uploads=On, this just isn't working.
Does anyone know of any other settings I need on my webserver or PHP.ini to allow file uploads????
This is totally baffling me here...
Thanks in advance everyone!
-Todd
<?php
$file_dir="/web/myserver.com/images/";
$file_url="http://www.myserver.com/images/";
//Print out $_FILES
while ( list ($key, $val) = @each($_FILES['fupload']) ){
echo "_FILES $key : $val <br>";
}
if(isset($_FILES['fupload']))
{
$upl_clientname = $_FILES['fupload']['name'];
$upl_servtmpname = $_FILES['fupload']['tmp_name'];
$upl_size = $_FILES['fupload']['size'];
$upl_type = $_FILES['fupload']['type'];
print "path : $upl_clientname<br>\n";
print "name : $upl_servtmpname<br>\n";
print "size : $upl_size bytes<br>\n";
print "type : $upl_type<br>\n\n";
if($upl_servtmpname)
{
copy($upl_servtmpname,$file_dir) or die ("Could not copy");
print "<img src=\"$file_url/$fupload_name\"><p>\n\n";
}
}
?>
<form name="form1" enctype="multipart/form-data" action="<?php echo $PHP_SELF ?>" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="102400">
<input type="file" name="fupload">
<input type="submit" value="upload">
</form>