WordPress.org

Ready to get started?Download WordPress

Forums

Contact Form 7
[resolved] [Contact Form 7] Can't see images uploaded to Media Library after using CF7 (9 posts)

  1. markhem
    Member
    Posted 7 months ago #

    When I try to upload new images into my media library they upload, but I cannot see them. The images are just gray.

    I've been trying to set up Contact Form 7 so users can attach images to their email. Images weren't uploading via Contact Form 7, so I followed the direction to set up a temporary folder for processing. The directions say; "You can also change the path of the temporary folder by setting the WPCF7_UPLOADS_TMP_DIR constant in your wp-config.php like this:
    define( 'WPCF7_UPLOADS_TMP_DIR', '/your/file/path' );
    If WPCF7_UPLOADS_TMP_DIR is defined, this directory is used as the temporary folder instead."

    When I added that code to the wp-config.php file and refreshed, all the images on my site disappeared. They were still in the media directory, of course, but I could only see the placeholder names in the webpages, no images. When I tried to upload new images they uploaded into the media library, but I couldn't see them. The images are just gray.

    I went back to my wp-config.php and deleted the line of code. But still, no images.
    I uninstalled Contact Form 7, went into my server files and deleted the folders that were placed in my uploads folder. It deleted the contents of the folder, but the folders themselves won't delete from the server. Still no images appear on my site.
    I have a small site in its infancy so I dropped the Db, deleted my installation of WP, uploaded a new instance of WP and set up a new DB. Got everything working again. The images are uploading to the /wp-content/uploads/2013/11 folder, but I can't see them.

    When I added that code to my wp-config.php file did it add something to the uploader as well?

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

  2. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 7 months ago #

    What actual value did you set in the WPCF7_UPLOADS_TMP_DIR constant?

  3. Jo Menhinick Design Ltd
    Member
    Posted 7 months ago #

    Maybe try altering the Permissions on the folder to 755 with filezilla?

  4. markhem
    Member
    Posted 7 months ago #

    Thanks for the reply Takayuki and Jo. I should say that I have a small site so last night I dropped the Db and deleted all my files again, including the hidden .htaccess this time, re-installed and rebuilt. All is working but I haven't re-installed CF7. I am grateful to you for offering CF7. Its been working well for my regular contacts, I'd like to get it working for image upload. But, because I am a beginner I am a little reluctant to re-install it, though I want to.

    For a path I used

    define( 'WPCF7_UPLOADS_TMP_DIR', '/var/www/html/wp-content/uploads' );

    I've deleted them now but they were in the uploads directory like this;

    var/www/html/wp-content/uploads/2013
    var/www/html/wp-content/uploads/wpcf7_uploads
    var/www/html/wp-content/uploads/wpcf7_captcha

    I think Jo might be right about permissions because later I clicked the image link and got a message about not having permission. If that is true, where would I find folder 755, and what would I change it to? From what I have been reading I thought maybe something got changed in the .htaccess file, or I had to change something in that file.

    http://www.claynet.ca

  5. Takayuki Miyoshi
    Member
    Plugin Author

    Posted 7 months ago #

    This was the cause of the issue.

    define( 'WPCF7_UPLOADS_TMP_DIR', '/var/www/html/wp-content/uploads' );

    wp-content/uploads is a directory which WordPress itself uses for uploaded media files. You should not set it as the temporary folder which the plugin uses. As files in the temporary folder are temporary, they are to be cleared periodically.

  6. markhem
    Member
    Posted 7 months ago #

    Would this be a good file path?

    define( 'WPCF7_UPLOADS_TMP_DIR', '/var/www/html/wp-content/contactformseven' );

    I am using a Twenty Twelve Child theme.

  7. markhem
    Member
    Posted 7 months ago #

    Hey Takayuki - I've been re-reading the help material on uploads that you have provided.

    "The location of the temporary folder depends upon your settings in WordPress. Open the Settings > Miscellaneous (Settings > Media if you use WordPress 3.0 or higher) menu, and check the setting for Store uploads in this folder field. The default is wp-content/uploads. Normally, Contact Form 7 creates a wpcf7_uploads folder in this location and uses it as the temporary folder for any uploaded files."

    "This folder is created automatically, but sometimes it can fail. The most possible reason for this is that the parent folder doesn’t have sufficient writing permissions. In such cases, you can change the permissions or create a folder manually."

    I think what happened is, I didn't realize the folder had been created, and I didn't actually check to see it the parent folder had sufficient writing permissions. Before I add the code to my wp-config.php file I think I will go back and try again to run the plugin and see if it has the proper permissions.

  8. markhem
    Member
    Posted 7 months ago #

    I have re-installed CF7 and the image uploader is working brilliantly. I don't know what happened that it wasn't working in the first place. It always sent text, just not images. Then I got in there and messed it up. Entirely my mistake. Now it sends images and messages, and its great! Thank you for your time and for this great plugin.

  9. simonlindner
    Member
    Posted 7 months ago #

    Just if anyone comes here via Google (as I did): In my case the issue was a Fatal Error because of a too low memory limit. It was shown in the firebug console when I opened my media library.

Reply

You must log in to post.

About this Plugin

About this Topic