Title: Filepath problem
Last modified: August 22, 2016

---

# Filepath problem

 *  [serandom](https://wordpress.org/support/users/serandom/)
 * (@serandom)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filepath-problem/)
 * Hi,
 * Thanks for great plugin, but lately I found a problem.
 * I am using this plugin to add manually watermark to images -> [https://wordpress.org/plugins/image-watermark/](https://wordpress.org/plugins/image-watermark/)
   and it works fine with newly uploaded images to media library.
 * When I replace image, and than try to add watermark there is a path problem “
   Warning: getimagesize(**//wp-content/uploads//wp-content/uploads**/2014/12/test-
   image-1.jpg) [function.getimagesize]: failed to open stream: No such file or 
   directory in /wp-content/plugins/image-watermark/image-watermark.php on line 
   1022″.
 * When I delete test-image-1.jpg from media library and upload it again, image 
   watermark works ok – it seems there is a problem with replaceing image.
 * [https://wordpress.org/plugins/enable-media-replace/](https://wordpress.org/plugins/enable-media-replace/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [serandom](https://wordpress.org/support/users/serandom/)
 * (@serandom)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/filepath-problem/#post-5598501)
 * $data = wp_get_attachment_metadata($media_id, FALSE);
 * After uploading image to media library:
    $data[file] => 2014/12/test-image-1.
   jpg
 * After replacing image:
    $data[file] => **/wp-content/uploads/**2014/12/test-image-
   1.jpg
 *  [Måns Jonasson](https://wordpress.org/support/users/mungobbq/)
 * (@mungobbq)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/filepath-problem/#post-5598730)
 * This is strange, since I am using the core WP method to generate the metadata
   upon replacing:
 * wp_generate_attachment_metadata()
 * Also, I am using the GUID from the database so this really should not happen 
   unless WP uses a different method to generate the path stored in the database
   on upload.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Filepath problem’ is closed to new replies.

 * ![](https://ps.w.org/enable-media-replace/assets/icon-256x256.png?rev=1940728)
 * [Enable Media Replace](https://wordpress.org/plugins/enable-media-replace/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enable-media-replace/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enable-media-replace/)
 * [Active Topics](https://wordpress.org/support/plugin/enable-media-replace/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enable-media-replace/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enable-media-replace/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Måns Jonasson](https://wordpress.org/support/users/mungobbq/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/filepath-problem/#post-5598730)
 * Status: not resolved