Reputation: 8083
For some reason, my PHP-upload field doesn't accept pdf-files. I don't get it cause I thought there is no selection made while uploading the file... Any advice?
$name = $_FILES["uploadedfile"]["name"];
$tmp_name = $_FILES["uploadedfile"]["tmp_name"];
$add = "downloads/lkverslagen/".$name;
move_uploaded_file($tmp_name, $add);
if(file_exists("downloads/lkverslagen/$name")) {
$lkverslag = new LKverslag();
$jaar = date (Y);
$lkverslag->titel = $titel;
$lkverslag->datum = $datecorrect;
$lkverslag->link = $name;
$lkverslag->jaar = $jaar;
$lkverslag->auteur = $_SESSION['user']['naam'];
$lkverslag->teller = $_POST['titel'];
if ($lkverslag->saveverslag($_DB)) {
$feedback = "OK";
} else {
$feedback = "NOT OK";
}
} else {
$feedback = "ERROR";
}
Upvotes: 0
Views: 798
Reputation: 2490
So, to repeat my comment: there are limits on the allowed size of uploaded files -- the PDF file might simply be too large.
Upvotes: 1
Reputation: 6679
Here are some things to check:
Ensure that your file upload and post limits are not reached by editing upload_max_filesize
and post_max_size
in your .htaccess
or php.ini
file. If you have error reporting on, you should see an error when they're reached. See this: http://drupal.org/node/97193
Check for file upload error codes. See the documentation for these: http://www.php.net/manual/en/features.file-upload.errors.php
Ensure that your memory_limit
has not been reached. Again, with error logging enabled, you should receive an error message about this. http://drupal.org/node/207036
Check PHP's common pitfalls documentation and make sure there's nothing there that helps: http://www.php.net/manual/en/features.file-upload.common-pitfalls.php
If none of this helps, enable error reporting and post what you receive so we can tailor our answers better to your situation.
Upvotes: 3