HTTPS Transfer
-
Is it possible to have the PDFs created go to a server via HTTPs transfer?
-
Hi,
I’m not sure what you mean. Do you mean the website where Gravity PDF is installed is using HTTPS and you want to view the PDF over HTTPS too? Or you want to securely transfer the PDF to another server once generated?
Thank you for your reply. I would like to transfer the PDF to another server once generated.
You can use the gfpdf_post_pdf_save action hook to send the PDF to another server once it has been generated and saved.
Thanks for the tip. That definitly looks like what I need but my server requires a username and password to access. How would I implement that into the code?
Hi,
It depends what kind of authorisation process you are using. Unfortunately that request is outside the support we provide. However, there are a lot of resources online to help you.
Maybe I’m not understanding. I’m testing this out on our webserver which is hosted on Host Gator and doesn’t need authorization. This is thr string I’m using:
function gfpdfe_post_pdf_save($form_id, $lead_id, $arguments, $filename)
{
/*
* This hook is useful if you want to move the PDFs to a new location
*/
$pdf_name = basename($filename);if($form_id == 13)
{
/* Use the $form title in the URL
* Depending on what name you use and your server OS, this might need parsing the form name further to remove invalid folder characters
*/
$form = RGFormsModel::get_form_meta($form_id);
$form_title = $form[‘Personal Information’];/* this assumes the directory already exists */
copy($filename, ‘/home/forms/public_html/pdfs/’ . $form_title. ‘/’ . $pdf_name);
}
}add_action(‘gfpdf_post_pdf_save’, ‘gfpdfe_post_pdf_save’, 10, 4);
but nothing ends up in the pdfs folder. Am I doing something wrong?
Hi,
You asked for details on transferring the PDF over HTTPS. The code you have pasted is just trying to copy the PDF to another directory on your file system – hence the confusion.
In your configuration file have you set
'notifications' => trueor'save' => true? As per the documentation I linked to, this function only fires if one of those two parameters are set. Note: if you set notifications to ‘true’ you actually have to have a notification enabled for that form.If it still isn’t working you should proceed with standard debugging – i.e run an echo at the start of the function to see if it fires, then check if your IF fires, then debug your copy() function.
The topic ‘HTTPS Transfer’ is closed to new replies.