I'm trying to get FPDF to save the file directly to the desktop but I can not find it, I keep saving it in the downloads folder and it gives me the name of the file. Can someone help me?
$pdf->Output('/C:/Users/Desktop/Fichas/ficha.pdf','D');
I'm trying to get FPDF to save the file directly to the desktop but I can not find it, I keep saving it in the downloads folder and it gives me the name of the file. Can someone help me?
$pdf->Output('/C:/Users/Desktop/Fichas/ficha.pdf','D');
If you make the download using the browser, who decides where to save it is the browser in case you use chrome. When you make the call with the parameter 'D'
what you indicate is that forces the browser to perform the download and since the name includes a route, this is how the file is named.
$pdf->Output('/C:/Users/Desktop/Fichas/ficha.pdf','D');
It is likely that the configuration you are looking for is
$pdf->Output('F', 'C:/Users/Desktop/Fichas/ficha.pdf');
Which will possibly save the file in the path you want, as long as it is the computer that runs the server.
Note that the parameter 'F'
goes in the first position since the documentation indicates that this parameter should go first, although when doing the so-called Output the code internally changes the parameters so that the first one is I or D or F or S and the second name of the file.
So the value F indicates to save the file in local (referring to the server where it is executed).