By using’s services you agree to our Cookies Use and Data Transfer outside the EU.
We and our partners operate globally and use cookies, including for analytics, personalisation, ads and Newsletters.

  • Join the Best Wordpress and Elementor Support forum

    Provide or get advice on everything Elementor and Wordpress, ask questions, gain confirmation or just become apart of a friendly, like minded community who love Wordpress and Elementor

    Join us!
elementor official

Allow Download File after form submitting (Custom Form Action)



New Member

I would like to allow user to download a file after submitting a form, without redirect ( I need user stay on the form page).
So i've used Custom form action to add function to the form. ( i can't add link but the page is 'custom-form-action' form site)

My last problem is in the run function :

I've tried to start download using readfile, but that doesn't work.

public function run( $record, $ajax_handler ){header('Content-Type: application/pdf');
        header("Content-Transfer-Encoding: Binary");
        header("Content-disposition: attachment; filename=File.pdf");

I suppose i need asynch function ?

Do you know if i can use this function to send file to user browser ?


Could you help me please ?
Last edited:

Latest posts

Latest Resources

Other Elementor Resources

elementor official