i have a PHP form to insert scientific publication references into a MySQL database; the fulltext PDF's should be uploaded into the file system, and the "where-to-find" infomration (path, size, ...) should be stored in the 'files' table. But...
Everytime i am trying to upload a PDF using
Code: Select all
if (isset ($_POST["is_uploaded_file"])) {
$fileaccess = $_POST["ftacc"];
$filedesc = "Fulltext PDF for $id";
$ver = $id;
$edocid = "0";
$col = "10126";
$grp = "0";
$extension = ".pdf";
$filetype = $_FILES["file"]["type"];
$filesize = $_FILES["file"]["size"];
$filename = $_FILES["file"]["name"];
$filetemp = $_FILES['file']['tmp_name'];
$fileerror = $_FILES['file']['error'];
$filename_new_a = "$id$extension";
$filename_new_b = "$id";
$registered_types = array(
"application/pdf" => ".pdf");
$allowed_types = "application/pdf";
if ($filesize <= $max_file_size) {
if ($filetype == $allowed_types) {
if (is_uploaded_file($filetemp)){
move_uploaded_file($filetemp,"$pdfdir_pub/".$filename_new_b."$extension");
chmod ("$pdfdir_pub/$filename_new_a", 0644);
$file_new = "$pdfdir_pub/$filename_new_a";
$filetype = $_FILES["file"]["type"];
$filesize = $_FILES["file"]["size"];
$localname = "$id$extension";
$md5 = md5($board . $filetype . $filesize . $localname);
$filequery = "INSERT INTO DBpub.files (ver,docid,oldid,edocid,filename,fcomment,mimetype,size,md5,col,grp,rm,ts,viewftext,year,fileerror)";
$filequery = $filequery."VALUES('".$ver."','".$id."','".$aid."','".$edocid."','". $filename_new_a."','".$filedesc."','".$filetype."','".$filesize."','".$md5."','". $col."','".$grp."','".$timestamp_date."','".$timestamp_date."','". $fileaccess."','".$p03."', '".$fileerror."')";
$fileerg = mysql_query($filequery) or die(mysql_error());}}}}Code: Select all
# [Wed Jan 03 11:44:07 2007] [error] [client 149.217.48.20] PHP Warning:
# move_uploaded_file() [<a href='function.move-uploaded-file'>function.move-uploaded-file</a>]:
# Unable to move '/local/sources/tmp/php6pa41w' to '/pdf/fulltext/6700.pdf' in /var/php/puma/pumaMainInputPDF.php on line 40,
# referer: https://puma.mpimf-heidelberg.mpg.de/.puma/redaktion/formulare/aenderung/index04.phpviewtopic.php?t=58657&highlight=moveuploadedfile
an that's the output:
Code: Select all
root@web1<2> php test.php
<pre>
path: /local
file_exists(/local): true
is_file(/local): false
is_dir(/local): true
is_readable(/local): true
is_writable(/local): true
is_executable(/local): true
</pre>
<pre>
path: /local/sources
file_exists(/local/sources): true
is_file(/local/sources): false
is_dir(/local/sources): true
is_readable(/local/sources): true
is_writable(/local/sources): true
is_executable(/local/sources): true
</pre>
<pre>
path: /local/sources/pdf
file_exists(/local/sources/pdf): true
is_file(/local/sources/pdf): false
is_dir(/local/sources/pdf): true
is_readable(/local/sources/pdf): true
is_writable(/local/sources/pdf): true
is_executable(/local/sources/pdf): true
</pre>
<pre>
path: /local/sources/pdf/fulltext
file_exists(/local/sources/pdf/fulltext): true
is_file(/local/sources/pdf/fulltext): false
is_dir(/local/sources/pdf/fulltext): true
is_readable(/local/sources/pdf/fulltext): true
is_writable(/local/sources/pdf/fulltext): true
is_executable(/local/sources/pdf/fulltext): true
</pre>
<pre>
path: /local/sources/pdf/fulltext/6700.pdf
file_exists(/local/sources/pdf/fulltext/6700.pdf): false
is_file(/local/sources/pdf/fulltext/6700.pdf): false
is_dir(/local/sources/pdf/fulltext/6700.pdf): false
is_readable(/local/sources/pdf/fulltext/6700.pdf): false
is_writable(/local/sources/pdf/fulltext/6700.pdf): false
is_executable(/local/sources/pdf/fulltext/6700.pdf): false
</pre>Anyone any idea?
Thanx in Advance (and a happy new year), yours
- bluenote