WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. bradsgold
    Member
    Posted 2 years ago #

    Hi,

    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,
    Bradley

    http://wordpress.org/extend/plugins/contact-form-7/

  2. myassouline
    Member
    Posted 1 year ago #

    Bradley,
    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?
    Thanks

  3. bradsgold
    Member
    Posted 1 year 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
    Member
    Posted 1 year ago #

    http://contactform7.com/file-uploading-and-attachment/
    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
    Member
    Posted 1 year 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:
    /wp-content/plugins/contact-form-7/includes/classes.php

    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

About this Topic