Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is an article <a href="http://whmcs.argentina--software.com.ar/index.php?title=Store_Pdf_Invoice_on_ftp" rel="nofollow">Store Pdf Invoice on ftp</a> with this information:</p> <p>1-Change in this code<br> <code>INVOICESDIRECTORY</code> - directory where I'm keeping PDF invoices<br> <code>ADMINDIRECTORY</code> - administration directory<br> 2- Paste it in last line of <code>invoicepdf.tpl</code> file in Your template.</p> <pre><code>if ($status=="Paid") { if(strpos($_SERVER['PHP_SELF'],"ADMINDIRECTORY") === false) { if((strpos($_SERVER['PHP_SELF'],"dl.php") !== false) || (strpos($_SERVER['PHP_SELF'],"dl.html") !== false)) { if(!file_exists("./INVOICESDIRECTORY/".str_replace("/", "-", $invoicenum).".pdf")) { $pdf-&gt;Output("./INVOICESDIRECTORY/".str_replace("/", "-", $invoicenum).".pdf", "F"); } $fullPath = "./INVOICESDIRECTORY/".str_replace("/", "-", $invoicenum).".pdf"; if ($fd = fopen ($fullPath, "r")) { $fsize = filesize($fullPath); $path_parts = pathinfo($fullPath); $ext = strtolower($path_parts["extension"]); switch ($ext) { case "pdf": header("Content-type: application/pdf"); // add here more headers for diff. extensions header("Content-Disposition: attachment; filename=\"".str_replace("-", "/", $path_parts["basename"])."\""); // use 'attachment' to force a download break; default; header("Content-type: application/octet-stream"); header("Content-Disposition: filename=\"".str_replace("-", "/", $path_parts["basename"])."\""); } header("Content-length: $fsize"); header("Cache-control: private"); //use this to open files directly while(!feof($fd)) { $buffer = fread($fd, 2048); echo $buffer; } } fclose ($fd); exit; } } else { if(!file_exists("./../INVOICESDIRECTORY/".str_replace("/", "-", $invoicenum).".pdf")) { $pdf-&gt;Output("./../INVOICESDIRECTORY/".str_replace("/", "-", $invoicenum).".pdf", "F"); } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload