Contact Form 7
File uploading to specfic folder (5 posts)

  1. bradsgold
    Posted 4 years ago #


    Is there any way that when an end user uploads a file through the contact form plugin, it is uploaded to a specified folder on the web server? We would like users to upload mp4 files and restrict the file uploading to only these, but using the current functionality wouldn't work sending an email to the admin with the file attached, seeing as video files are somewhat large. Alternatively, if a direct link to the file in an upload folder is specified in an email that would work just as well instead of sending it as an attachment.

    Also, can I restrict the file upload types?

    Thank You,


  2. myassouline
    Posted 4 years ago #

    I am having the exact same need... (for pdf files, but it doesnot change the need in itself): I would like to retrieve uploaded files, but they are apparently deleted after upload: how is it possible to back these up or just retrieve them?

  3. bradsgold
    Posted 4 years ago #

    That's a good question! It would be helpful to receive a response from someone that has experienced this same scenario and has found a solution. Thanks in advance!

  4. kugelblitz
    Posted 4 years ago #

    Here is written that the Files are temporary uploaded and deleted.
    Also how the upload directory is changed.
    Now you need to find out how not to delete the temporary files.

  5. MalachiConstant
    Posted 4 years ago #

    I just came to see if anyone had a solution to this same question.

    After a bit of nosing around in the code, the solution is to edit the following file:

    Search the file for @unlink (there's only one instance of it) and comment out the loop:

    foreach ( (array) $this->uploaded_files as $name => $path ) {
        @unlink( $path );

    within the submit function. Job's a good 'un.

    This solution is for version 3.1.2 running on WP 3.2.2

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Contact Form 7
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic