Updated config file, didn't solve. Checked all URL's, nope!
Posted: Wed Mar 22, 2006 8:51 pm
I'm doing a simple image upload and basically as I'm sure all of you are aware no matter what tutorial I find on the internet the code is basically the same (for just simple image uploads).
But what I am finding is that it keeps returning "Possible image upload attack!".
I have changed the config file to the following:
"config.inc.php"
$cfg['UploadDir'] = 'http://www.mydomain.com/images/';
In my upload.php file:
Notice the two upload directories are the same. It keeps saying possible image upload attack. The file size is only a few Kilobytes, it must have something to do with the directory that which I am trying to upload to.
Can anyone offer any advice? As far as I know there are no restrictions that would disable image uploads on my server. I mean I changed it in my config file.
Regards,
Rob.
But what I am finding is that it keeps returning "Possible image upload attack!".
I have changed the config file to the following:
"config.inc.php"
$cfg['UploadDir'] = 'http://www.mydomain.com/images/';
In my upload.php file:
Code: Select all
<?php
// In PHP versions earlier than 4.1.0, $HTTP_POST_FILES should be used instead
// of $_FILES.
$uploaddir = 'http://www.mydomain.com/images/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
echo 'Here is some more debugging info:';
print_r($_FILES);
print "</pre>";
?>Can anyone offer any advice? As far as I know there are no restrictions that would disable image uploads on my server. I mean I changed it in my config file.
Regards,
Rob.