uploading pdf file
Posted: Mon Aug 21, 2006 1:01 pm
Hi,
guess what guys...i have a problem!
I'm trying to make a script for users, to upload files on my server. The problem is, i can only upload certain files. I would need to make this thing work for uploading .pdf files.
here is "my" script....
i can upload some .txt, .zip files with this, but can not upload .pdf file.
here is what i get in my browser.
type and tmp_name fields are empty...any idea how to make this thing work?
regards, Miha.
guess what guys...i have a problem!
I'm trying to make a script for users, to upload files on my server. The problem is, i can only upload certain files. I would need to make this thing work for uploading .pdf files.
here is "my" script....
Code: Select all
$uploaddir = './slic/';
$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>";here is what i get in my browser.
Code: Select all
Possible file upload attack!
Here is some more debugging info:Array
(
[userfile] => Array
(
[name] => somefile.pdf
[type] =>
[tmp_name] =>
[error] => 2
[size] => 0
)
)regards, Miha.