Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fpdf question

Status
Not open for further replies.

Bertiethedog

Programmer
Feb 8, 2007
118
GB
when I run this code
Code:
 $pdf->Output('F','c:\test.php');


I get this error

FPDF error: Incorrect output destination: C:\TEST.PHP


anybody got any ideas

TIA

Richard
 
I would first think of a rights problem. Can your web server user write to C:\? And is the safe mode off?
 
my login has administrator rights, I am running xp on the local machine.

could this be a firewall problem?

I want to pass the output to another prog to send as an email, does anyone know the syntax. This might be a better solution.

Regards


richard

 
could you try this instead

Code:
 $pdf->Output('F','c:[red]/[/red]test.php');
 
I had to generate a random pdf filename, this is how I done it. It might set you off in the right direction.

$random = (rand()%3000);
$filename="c:\\".$_POST[firstname].$_POST[lastname].$random.".pdf";

$pdf->Output($filename);
 
Thank you very much, I should be able to sort out my problem to-night


Kind Regards

Richard
 
I should have said thankyou ALL for your valuable help


Richard
 
for random filenames (although this would be a different issue in fact), i would recommend the use of tempnam(), which is designed for this purpose.

on permissions: I think that DonQuichote has probably hit the nail on the head. Bertiethedog, remember that the login that you are using is unlikely to be the determining factor. you need more to look at which user the webserver/php process is running as. assuming you are using IIS then this user will be IUSR_MACHINENAME. you will need to make sure that this user has write privileges on the root directory (which has got to be a bad idea unless you're very certain of your firewall!). You can do this by right clicking the directory, selecting properties and then selecting the security tab.


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top