WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to use a form from the Contact Form 7 plugin to allow the users to upload a document to my website. The problem is that I'd like to manage those uploads from WordPress instead of receiving them in my E-Mail.

Is there a way of redirecting the output of those forms to a PHP script, or something similar?

share|improve this question

closed as off-topic by kaiser Jul 28 '14 at 14:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 6 down vote accepted

Take a look at the wpcf7_before_send_mail hook CF7 provides.

add_action("wpcf7_before_send_mail", "wpcf7_do_something_else_with_the_data");
function wpcf7_do_something_else_with_the_data(&$wpcf7_data)

    // Everything you should need is in this variable

    // I can skip sending the mail if I want to...
    $wpcf7_data->skip_mail = true;

share|improve this answer
Wow, this is brilliant, exactly what I was looking for. Thank you! – José Tomás Tocino Mar 6 '12 at 19:02

Using var_dump here is not a good idea because you will write the output to the buffer and break the form submission. Use error_log wordpress functions with print_r or var_dump with the following code instead :

ob_start();                      // start buffer capture
var_dump($wpcf7_data);           // dump the values
$contents = ob_get_contents();   // put the buffer into a variable
ob_end_clean();                  // end capture
error_log($contents);            // Write to wp-content/debug.log (enable debug mode to see it).
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.