Support » Fixing WordPress » [Plugin: Contact Form 7] Possible to attach a file in my wp-content/uploads folder?

  • Instead of attaching a file uploaded by the user, can I attach a file found in my wp-content/uploads folder?

    For example, when the user completes the form, I would like to send the normal email to me for notification, and then send a separate email to them with an “information packet” zip file attached. This file would be sent to all users who complete the form.

Viewing 7 replies - 1 through 7 (of 7 total)
  • With the new release of version 1.10, I can use some simple javascript to redirect the user to get the file. I put this in the “Additional Settings” window.

    on_sent_ok: “location.replace(‘http://myurl?getfile=#’);”

    It works great! The form is submitted, email is sent, and the user is prompted with the download box for the file (they are even kept on the same form). However, it seems like this breaks the “Sender’s message was sent successfully” confirmation box (it never appears).

    If I enter the form with missing required values, no download box appears (which is great!) and the “error” confirmation box appears as expected.

    This is not a huge issue for me, but I felt like I should bring it up since I’m not sure if the problem is with my code or a larger issue with the way the javascript action hook is handled.

    Is it possible to use on_sent_ok to forward to another page? If so how could you achieve this?

    on_sent_ok: window.location = “”

    Does not work…



    on_sent_ok: “location.replace(‘’);”

    Should work. If you try to open a new window it will probably be blocked like a popup.

    I am using this:

    on_sent_ok: “location.replace(‘’);”

    And it doesn’t work. Can someone please help me! I’m desperate and I can’t find a solution anywhere!

    I can’t get it either! This is killing me here. I’ve tried everything imaginable. Why is this working for some and not for others? Even just a simple location.replace, still not getting it to work.

    to kfrost!

    you have to have

    <?php wp_footer(); ?>

    in the footer of your theme for this to work!!!


    Thanks for your update. I tried it, but after adding your line, the thankyou page does not load and I noticed the following error message on the page:

    Message: Invalid character
    Line: 95
    Character: 57
    Code: 0

    Any thoughts? I use Atahualpa.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Contact Form 7] Possible to attach a file in my wp-content/uploads folder?’ is closed to new replies.