Save PDF file in predefined path

Guys I’m trying to save pdf file in pre-defined path, but it’s not saving file in predefined path instead providing saveas option.

I’m using FPDF.

Below is my CODE

  $pdf=new FPDF();
    $txt = "Legal Document of Mr." .$result[0]['first_name'];
    $content = "This is the AGREEMENT to purchase made by ".$result[0]['first_name'] ." from SriramProperties on day 7/12/2017,";
    $content = "is located at " . $result[0]['location']."and his dob is ".$result[0]['dob']." will be owner of the plot";
 		$filename="../pdf/pdfdocument.pdf"; //path im trying to save

Need solution for this…It’s urgent

If I’m reading the FPDF documentation correctly, then this line


is incorrect, the first parameter should be the destination (“F” in your case) and the second parameter is the name. Note that the filename is a local filename.

Try setting error_reporting(-1); and ini_set('display_errors, ‘true’);

I think it may give an error stating the path permissions are incorrect.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.