• Hey,

    First of all super nice plugin. Used it multiple times with no problems until now.

    I have a WordPress website v4.4.1, Contact form 7 v4.3.1 and Email before download v3.4. The whole form works, when i input all the info and hit send i get a button to download a PDF or doc file. But when I click the download button a new blank page opens with the following URL domainname.com/wp-content/plugins/email-before-download/download.php?dl=e638e9438fb80b8fbd91613dfad6191c instead of domainname.com/wp-content/uploads/dlm_uploads/2015/06/RKMboek.pdf

    I already looked at everything I could think of. In Email before download the files are uploaded correctly with the right URL, my forms are correct, my shortcodes are correct.

    Can you help me with this problem?

    https://wordpress.org/plugins/email-before-download/

Viewing 4 replies - 1 through 4 (of 4 total)
  • make sure you are using “your-email” as the field in your form name (in Contact Form 7). While I don’t see how having it named something else could cause the problem you are seeing, a couple of other folks have reported the same thing & they had given the email field some other name. So, make sure yours is “your-email”.

    Also, make a new test page. Make a new contact form (and make the field “your-email”). Upload a new file with a filename you have never used before. Make the file be a .jpg, not a .pdf. Try that. Post your shortcode into this ticket along with the test URL.

    are you set to “inline”, “email”, or “both”?
    are you set to masked URL?

    Thread Starter benjamin3105

    (@benjamin3105)

    SHiiiiiii

    I did like you said, changed [naam] (name in dutch) to [your-name] and same for [email] to [your-email] and everything works fine now.

    This happened after the host was upgraded and maybe the update of WordPress or something changed something but I’m glad this fixes it.

    Many many thanks 🙂 🙂

    For other ppl with same problems, try to use the standard [your-name] [your-email] like dtynan said

    It looks like a very specific setting of $email to the short code name ‘your-email’ from CF7 seems to be the culprit here:

    Line 406 email-before-download.php

    $email = $cf7->posted_data[‘your-email’];
    //compare email againts not allowed domains.
    $forbidden_domains = get_option(’email_before_download_forbidden_domains’);
    $domains = explode(‘,’, $forbidden_domains);

    Then again at: 525

    $link_data[’email’] = $cf7->posted_data[‘your-email’];

    which causes the insert at line 528 to fail

    $wpdb->insert( $table_link, $link_data );

    So the download mapping is not properly passed to the user.

    The code is correct right there. Note line 50 of email-before-download.php where it creates the $table_link table. The field name in the database is ’email’. That is why line 525 says $link_data[’email’]

    As I said, the field in the table is ’email’. However, the field name in the form that you are supposed to use is ‘your-email’ as is documented on the FAQ page and on the screenshots page.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Email before download wrong blank url’ is closed to new replies.