Hallo Coders, I want to create a temporary file on a remote linuxserver with the following program. This code creates no file and no errormessage is returned.
How can I solve this problem?
<?php
$p = PDF_new();
pdf_open_file($p, \"\");
PDF_set_info($p, \"Creator\", \"$PHP_SELF\");
PDF_set_info($p, \"Author\", \"Planung und Realisierung, Oliver Sander, PWA-MI\");
PDF_set_info($p, \"Title\", \"create_test.pdf (PHP)\");
pdf_begin_page($p, 595, 842);
pdf_set_font($p, \"Times-Roman\", 16, \"host\");
pdf_set_text_pos($p, 50, 700);
pdf_show($p, \"Hallo \'create_test.php\' hat mich in ein PDF-File geschrieben!\");
pdf_end_page($p);
pdf_close($p);
$buf = pdf_get_buffer($p);
$len=strlen($buf);
header(\"Content-type: application/pdf\");
header(\"Content-Length: $len\");
header(\"Content-Disposition: inline; filename=create_test.pdf\");
print $buf;
*creating temp. pdf file************
$tempurl=\"ftp://dpf1sov:umwelt1174@10.211.18.116/usr/local/httpd/htdocs/umweltteam/temp_files\";
$tempfn=tempfile(\"$tempurl\", \"tfile\");
$fp = fopen(\"$tempurl/$tempfn\", \"a\");
if ($fp)
{
flock($fp,2);
fputs ($fp, $buf);
echo \"Vielen Dank, $vn $nn<p>\";
echo \"Ihre Angaben wurden gespeichert<p>\";
flock($fp,3);
fclose($fp);
}
else
echo \"Datei konnte nicht zum Schreiben geƶffnet werden<p>\";
pdf_delete($p);
?>
Thank you
Yours Oliver