Save Pdf and send via API

By: Thompson Fiuzzi | Asked: 11/02/2023
ForumsCategory: Code HelpSave Pdf and send via API
Thompson Fiuzzi asked 1 year ago

Hi, I'm trying to save the PDFs created thanks to formidable and then send them via API to another server, but I can't find any documentation on the matter.
Has anyone had similar experiences?

--------------

My goal is to send my pdf form via API.

After the user submits the form, an email with the PDF is sent to them.

The process:

1 I created my form where I collect my customer's data.
2 I created the view where I inserted the fields.
3 I created the message in action & notification that downloads the PDF
[frm-pdf view=x entry="[id]" public=1] I would like to send the pdf I created via API.

THX

4 Answers
Victor Font answered 1 year ago
By definition, API communication takes place with JSON REQUEST/RESPONSE. I’ve never heard of any API that can handle file transfers. That’s usually done with ftp.
Thompson Fiuzzi answered 1 year ago
Thanks for your answer, even using an ftp how can I intercept the pdf file created with formidable given that the file is created "on the fly" by calling a view? Thank you.
Victor Font replied 1 year ago

The file, when it's created, has to written to some directory, doesn't it? The frm_pdfs_download_url filter is the hook where you can retrieve the file's URL to trigger an FTP transfer. https://formidable-masterminds.com/codexv2-hook-detail/?codex_id=4328&entry_type=Filter&return_page=codexv2-filter-list#field_4328_detail_link

Rob LeVineRob LeVine answered 6 months ago
I just recently felt your pain. The file doesn't actually ever get saved to the server because, as you said, it's all on the fly. I found a way to force the file to save on the server. Let me be completely clear that I don't know if it's secure. All I can say is that it works. See my code sample here. It requires that your server has CURL enabled.
Rob LeVineRob LeVine answered 5 months ago
I created a tutorial for my solution 

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right