...

View Full Version : Upload Error 1



jaywhy13
09-01-2006, 04:28 PM
$uploaddir = '/home/jay/miguel/music/';
$uploadfile = $uploaddir . basename($_FILES['mediaFile']['name']);
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 '<pre>';
print_r ($_FILES);
echo '</pre>';
}

Gets me the error
Possible file upload attack!

Array
(
[mediaFile] => Array
(
[name] => all 4 one - i can love you like that.mp3
[type] =>
[tmp_name] =>
[error] => 1
[size] => 0
)

)

Funny that code looks real simple... I have write permissions to the directory. What's wrong?

managedinternet
09-01-2006, 04:31 PM
look a few threads down for my code

exact same script as you are using :)

al the best

managedinternet
09-01-2006, 04:32 PM
think this might be your problem

if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile))

a few lines up you have
$_FILES['mediaFile']

use 1 or the other



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum