Hi All,
I hope someone can help me.
I have a laptop running windows XP pro SP2 with apache 2, mysql and php 4.3.11
and a server running OpenBSD 3.6 php 4.3.8 and mysql.
The problem I have is with uploading.
The script works fine on my laptop but not on the server.
I have check everything that the php manual specifies for the php.ini file and also compared both that and the httpd.conf files against my laptop and server and changed any differing configuration values to = my laptop.
This still hasnt fixed the issue and i get the exact same result when trying to upload.
From what I can see when I turned all my errors and notices on the userfile (being the input type=file) doesnt seem to be passed to the php handling the upload but everything else in the form is passed.
I receive the notice, Undefined Index: userfile when attempting.
Does anyone have any suggestions or ideas on this. Could it be a bug in the php version???
I am at a lost, I hope someone can help.
Thanks to all in advance that suggest or have any ideas on this troubling subject.
relevent code is below..
php Code:
Original
- php Code |
|
|
|
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
{
$uploaddir = './';
$uploadfile = $uploaddir . $_FILES['userfile']['name'];
{
echo "File is valid, and was successfully uploaded.n";
}
else
{
echo "Possible file upload attack!n";
}
echo 'Here is some more debugging info:';
}
?>
<HTML>
<form enctype="multipart/form-data" method="POST" action ="<?php echo $_SERVER['PHP_SELF']; ?>">
<!-- MAX_FILE_SIZE must precede the
file input field -->
<input type="hidden" name="MAX_FILE_SIZE" value="300000000" />
<!-- Name of input element determines name in
$_FILES array -->
Send this
file: <input name=
"userfile" type=
"file" />
<input type="submit" name="submit" value="Send File" />
</form>
</HTML>