Support » Plugin: Smush Image Compression and Optimization » [Plugin: WP] Error: Could not find: strange path

  • Resolved shortster


    When I create a post in the normal way and upload an image through the new post ‘add an image’ button everything goes fine. In the media-library I see the image is attached to the post and the image gets smushed.

    However if I upload an image through for example the commentbox (via a plugin) on the frontend of my website, the image gets uploaded to the media-library but the column says:
    “could not find /home/mysite/domains/”

    Note: the image is not attached to a post (unattached). Don’t know if that’s good or bad..

    Any idea what’s wrong here?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Found the error. When manually adding an uploaded image to the media library, you use:
    wp_insert_attachment( $attachment, $filepath);
    wp_generate_attachment_metadata( $attach_id, $filepath );
    Where $filepath needs to be the absolute path. I used the url. With the url in the metadata of the image WP tried to locate the image at
    absolutepath + url = /home/mysite/domains/

    Hope it makes sense 🙂

    It makes sense. But how do we fix it? I’m not using a plugin, only WP Media Library upload function and this error keeps showing.

    Any news on this topic?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: WP] Error: Could not find: strange path’ is closed to new replies.