WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] File upload - error 403 (2 posts)

  1. spooky_jack
    Member
    Posted 1 year ago #

    Hello,
    I'm using contact form 7, v. 3.2. I have an application of the form where I'm uploading pictures in my standard upload directory and keep them there. The user needs to be able to view those pictures at their current position: I mean that if they're uploaded on http://www.my_website.com/wp-content/uploads, when in a browser the user puts the link http://www.my_website.com/wp-content/uploads/my_photo.jpg, he must be able to see the photo.

    However, even if the pictures are uploaded correctly (and attached correctly) and still exist on the uploads folder, and both the pictures and the uploads file have full permissions, when the user tries to view them via a browser, a 403-forbidden message comes up. This wasn't the case with this folder before uploading anything from contact form 7. I'm guessing that I'm not allowed to browse directories but I'm not sure how to fix this. Any suggestions?

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

  2. spooky_jack
    Member
    Posted 1 year ago #

    Ok, after struggling for a day, I figured it out
    On modules/file.php there's this code:
    $htaccess_file = trailingslashit( $dir ) . '.htaccess';
    if ( file_exists( $htaccess_file ) )
    return;

    if ( $handle = @fopen( $htaccess_file, 'w' ) ) {
    fwrite( $handle, "Deny from all\n");
    fclose( $handle );
    }

    I had commented it, but, the .htaccess file was already created the first time I used the form as was originally. So, by deleting the .htaccess file, everything worked as required :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic