• Resolved F C

    (@pmagony)


    Hello Amigos,

    I’ve successfully created a WPCF7 Upload file page which allows my user to upload a file. I’m running into an issue where I need to give the user the option to delete the current file that is on the server, during the upload of the current file.

    The file needs to remain the same “name” on the server – it cannot change as we have a direct link that references it all the time. If we do not delete the file, then the upload script sequentially numbers the file when it detects the same file exists.

    file.txt
    file1.txt
    file2.txt
    and so on…

    I would like to put a checkbox that “deletes” the current file, while uploading the latest one.

    Or, negate the script from renaming the file and simply OVERWRITE the current one on the server during upload.

    Any help is greatly appreciated!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter F C

    (@pmagony)

    Resolved.

    In /contact-form-7/modules/file.php line 174:

    $filename = wp_unique_filename( $uploads_dir, $filename );

    Needs to be commented out. I also changed the CHMOD of the file to 0644 at line 185:

    @chmod( $new_file, 0644 );

    Thread Starter F C

    (@pmagony)

    I should mention that I did not add a “checkbox”. I simply tweaked the existing scripts functionality so that it’s automatic on the upload.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Contact Form 7] Checkbox to Delete from Server’ is closed to new replies.