Title: Error when uploading same image twice
Last modified: January 8, 2020

---

# Error when uploading same image twice

 *  Resolved [thema3x](https://wordpress.org/support/users/thema3x/)
 * (@thema3x)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/)
 * Hi,
    Thanks for the plugin. I use the form to allow users to submit own posts
   including image. However if the same image is uploaded twice, second time it 
   throws the error below:
 * ( ! ) Warning: imagepng(F:\WAMP\www\wordpress/wp-content/uploads/2020/01/e461-
   H1WKC2IwfPMzpng-300×166.): failed to open stream: Permission denied in F:\WAMP\
   www\wordpress\wp-includes\class-wp-image-editor.php on line 484
    Call Stack #
   Time Memory Function Location 1 0.0002 416888 {main}( ) …\index.php:0 2 0.0006
   417168 require( ‘F:\WAMP\www\wordpress\wp-blog-header.php’ ) …\index.php:17 3
   0.2626 6395080 wp( ) …\wp-blog-header.php:16 4 0.2626 6395128 WP->main( ) …\functions.
   php:1255 5 0.2626 6395128 WP->parse_request( ) …\class-wp.php:729 6 0.2643 6425872
   do_action_ref_array( ) …\class-wp.php:387 7 0.2643 6425872 WP_Hook->do_action()…\
   plugin.php:544 8 0.2643 6425872 WP_Hook->apply_filters( ) …\class-wp-hook.php:
   312 9 0.2643 6427000 usp_checkForPublicSubmission( ) …\class-wp-hook.php:288 
   10 0.2651 6436472 usp_createPublicSubmission( ) …\user-submitted-posts.php:276
   11 0.3108 6696032 usp_attach_images( ) …\user-submitted-posts.php:1154 12 0.3244
   7163536 wp_generate_attachment_metadata( ) …\user-submitted-posts.php:1038 13
   0.3247 7163984 wp_create_image_subsizes( ) …\image.php:476 14 0.3288 7168264 
   _wp_make_subsizes( ) …\image.php:362 15 0.3462 8999664 WP_Image_Editor_GD->make_subsize()…\
   image.php:435 16 0.3707 9222272 WP_Image_Editor_GD->_save( ) …\class-wp-image-
   editor-gd.php:275 17 0.3707 9222760 WP_Image_Editor_GD->make_image( ) …\class-
   wp-image-editor-gd.php:433 18 0.3708 9222760 WP_Image_Editor_GD->make_image( )…\
   class-wp-image-editor-gd.php:504 19 0.3708 9222736 imagepng ( ) …\class-wp-image-
   editor.php:484
 * ( ! ) Warning: imagepng(F:\WAMP\www\wordpress/wp-content/uploads/2020/01/e461-
   H1WKC2IwfPMzpng-150×150.): failed to open stream: Permission denied in F:\WAMP\
   www\wordpress\wp-includes\class-wp-image-editor.php on line 484
    Call Stack #
   Time Memory Function Location 1 0.0002 416888 {main}( ) …\index.php:0 2 0.0006
   417168 require( ‘F:\WAMP\www\wordpress\wp-blog-header.php’ ) …\index.php:17 3
   0.2626 6395080 wp( ) …\wp-blog-header.php:16 4 0.2626 6395128 WP->main( ) …\functions.
   php:1255 5 0.2626 6395128 WP->parse_request( ) …\class-wp.php:729 6 0.2643 6425872
   do_action_ref_array( ) …\class-wp.php:387 7 0.2643 6425872 WP_Hook->do_action()…\
   plugin.php:544 8 0.2643 6425872 WP_Hook->apply_filters( ) …\class-wp-hook.php:
   312 9 0.2643 6427000 usp_checkForPublicSubmission( ) …\class-wp-hook.php:288 
   10 0.2651 6436472 usp_createPublicSubmission( ) …\user-submitted-posts.php:276
   11 0.3108 6696032 usp_attach_images( ) …\user-submitted-posts.php:1154 12 0.3244
   7163536 wp_generate_attachment_metadata( ) …\user-submitted-posts.php:1038 13
   0.3247 7163984 wp_create_image_subsizes( ) …\image.php:476 14 0.3288 7168264 
   _wp_make_subsizes( ) …\image.php:362 15 0.3761 9000960 WP_Image_Editor_GD->make_subsize()…\
   image.php:435 16 0.3893 9106832 WP_Image_Editor_GD->_save( ) …\class-wp-image-
   editor-gd.php:275 17 0.3894 9107320 WP_Image_Editor_GD->make_image( ) …\class-
   wp-image-editor-gd.php:433 18 0.3894 9107320 WP_Image_Editor_GD->make_image( )…\
   class-wp-image-editor-gd.php:504 19 0.3895 9107320 imagepng ( ) …\class-wp-image-
   editor.php:484
 * ( ! ) Warning: imagepng(F:\WAMP\www\wordpress/wp-content/uploads/2020/01/e461-
   H1WKC2IwfPMzpng-768×424.): failed to open stream: Permission denied in F:\WAMP\
   www\wordpress\wp-includes\class-wp-image-editor.php on line 484
    Call Stack #
   Time Memory Function Location 1 0.0002 416888 {main}( ) …\index.php:0 2 0.0006
   417168 require( ‘F:\WAMP\www\wordpress\wp-blog-header.php’ ) …\index.php:17 3
   0.2626 6395080 wp( ) …\wp-blog-header.php:16 4 0.2626 6395128 WP->main( ) …\functions.
   php:1255 5 0.2626 6395128 WP->parse_request( ) …\class-wp.php:729 6 0.2643 6425872
   do_action_ref_array( ) …\class-wp.php:387 7 0.2643 6425872 WP_Hook->do_action()…\
   plugin.php:544 8 0.2643 6425872 WP_Hook->apply_filters( ) …\class-wp-hook.php:
   312 9 0.2643 6427000 usp_checkForPublicSubmission( ) …\class-wp-hook.php:288 
   10 0.2651 6436472 usp_createPublicSubmission( ) …\user-submitted-posts.php:276
   11 0.3108 6696032 usp_attach_images( ) …\user-submitted-posts.php:1154 12 0.3244
   7163536 wp_generate_attachment_metadata( ) …\user-submitted-posts.php:1038 13
   0.3247 7163984 wp_create_image_subsizes( ) …\image.php:476 14 0.3288 7168264 
   _wp_make_subsizes( ) …\image.php:362 15 0.3943 9000584 WP_Image_Editor_GD->make_subsize()…\
   image.php:435 16 0.4803 10315800 WP_Image_Editor_GD->_save( ) …\class-wp-image-
   editor-gd.php:275 17 0.4805 10316288 WP_Image_Editor_GD->make_image( ) …\class-
   wp-image-editor-gd.php:433 18 0.4805 10316288 WP_Image_Editor_GD->make_image()…\
   class-wp-image-editor-gd.php:504 19 0.4806 10316288 imagepng ( ) …\class-wp-image-
   editor.php:484
 * ( ! ) Warning: imagepng(F:\WAMP\www\wordpress/wp-content/uploads/2020/01/e461-
   H1WKC2IwfPMzpng-100×100.): failed to open stream: Permission denied in F:\WAMP\
   www\wordpress\wp-includes\class-wp-image-editor.php on line 484
    Call Stack #
   Time Memory Function Location 1 0.0002 416888 {main}( ) …\index.php:0 2 0.0006
   417168 require( ‘F:\WAMP\www\wordpress\wp-blog-header.php’ ) …\index.php:17 3
   0.2626 6395080 wp( ) …\wp-blog-header.php:16 4 0.2626 6395128 WP->main( ) …\functions.
   php:1255 5 0.2626 6395128 WP->parse_request( ) …\class-wp.php:729 6 0.2643 6425872
   do_action_ref_array( ) …\class-wp.php:387 7 0.2643 6425872 WP_Hook->do_action()…\
   plugin.php:544 8 0.2643 6425872 WP_Hook->apply_filters( ) …\class-wp-hook.php:
   312 9 0.2643 6427000 usp_checkForPublicSubmission( ) …\class-wp-hook.php:288 
   10 0.2651 6436472 usp_createPublicSubmission( ) …\user-submitted-posts.php:276
   11 0.3108 6696032 usp_attach_images( ) …\user-submitted-posts.php:1154 12 0.3244
   7163536 wp_generate_attachment_metadata( ) …\user-submitted-posts.php:1038 13
   0.3247 7163984 wp_create_image_subsizes( ) …\image.php:476 14 0.3288 7168264 
   _wp_make_subsizes( ) …\image.php:362 15 0.4879 9000960 WP_Image_Editor_GD->make_subsize()…\
   image.php:435 16 0.4983 9055248 WP_Image_Editor_GD->_save( ) …\class-wp-image-
   editor-gd.php:275 17 0.4984 9055736 WP_Image_Editor_GD->make_image( ) …\class-
   wp-image-editor-gd.php:433 18 0.4984 9055736 WP_Image_Editor_GD->make_image( )…\
   class-wp-image-editor-gd.php:504 19 0.4985 9055736 imagepng ( ) …\class-wp-image-
   editor.php:484
 * ( ! ) Warning: Cannot modify header information – headers already sent by (output
   started at F:\WAMP\www\wordpress\wp-includes\class-wp-image-editor.php:484) in
   F:\WAMP\www\wordpress\wp-includes\pluggable.php on line 1265
    Call Stack # Time
   Memory Function Location 1 0.0002 416888 {main}( ) …\index.php:0 2 0.0006 417168
   require( ‘F:\WAMP\www\wordpress\wp-blog-header.php’ ) …\index.php:17 3 0.2626
   6395080 wp( ) …\wp-blog-header.php:16 4 0.2626 6395128 WP->main( ) …\functions.
   php:1255 5 0.2626 6395128 WP->parse_request( ) …\class-wp.php:729 6 0.2643 6425872
   do_action_ref_array( ) …\class-wp.php:387 7 0.2643 6425872 WP_Hook->do_action()…\
   plugin.php:544 8 0.2643 6425872 WP_Hook->apply_filters( ) …\class-wp-hook.php:
   312 9 0.2643 6427000 usp_checkForPublicSubmission( ) …\class-wp-hook.php:288 
   10 2.5208 6748128 wp_redirect( ) …\user-submitted-posts.php:351 11 2.5208 6748208
   header ( ) …\pluggable.php:1265
 * ( ! ) Warning: Cannot modify header information – headers already sent by (output
   started at F:\WAMP\www\wordpress\wp-includes\class-wp-image-editor.php:484) in
   F:\WAMP\www\wordpress\wp-includes\pluggable.php on line 1268
    Call Stack # Time
   Memory Function Location 1 0.0002 416888 {main}( ) …\index.php:0 2 0.0006 417168
   require( ‘F:\WAMP\www\wordpress\wp-blog-header.php’ ) …\index.php:17 3 0.2626
   6395080 wp( ) …\wp-blog-header.php:16 4 0.2626 6395128 WP->main( ) …\functions.
   php:1255 5 0.2626 6395128 WP->parse_request( ) …\class-wp.php:729 6 0.2643 6425872
   do_action_ref_array( ) …\class-wp.php:387 7 0.2643 6425872 WP_Hook->do_action()…\
   plugin.php:544 8 0.2643 6425872 WP_Hook->apply_filters( ) …\class-wp-hook.php:
   312 9 0.2643 6427000 usp_checkForPublicSubmission( ) …\class-wp-hook.php:288 
   10 2.5208 6748128 wp_redirect( ) …\user-submitted-posts.php:351 11 2.5245 6748344
   header ( ) …\pluggable.php:1268

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

 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12306002)
 * Glad to help with this. Can you please list the steps required so I can replicate
   the issue and investigate asap. For example, the steps should look like this:
 * 1) Install WP, leave all settings at default
    2) Install USP, leave all settings
   at default 3) Change the Max image setting to some number 4) Try to submit two
   images 5) Etc.
 * So that anyone, anywhere could follow the steps and recreate your same issue.
   Let me know if any questions about this.
 *  Thread Starter [thema3x](https://wordpress.org/support/users/thema3x/)
 * (@thema3x)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12306089)
 * I mostly changed the fields, max image size and image element. I will add screenshots
   for them:
    [⌊2020-01-08_2236⌉](https://www.screencast.com/t/mkzqImtX) [⌊2020-01-08_2239⌉](https://www.screencast.com/t/czS6U2rkI)
   [⌊2020-01-08_2240⌉](https://www.screencast.com/t/nbcjXLnJhEXy) Steps: 1. After
   I changed these settings I submit the post from the form including the required
   image. So far so good. I’m able to approve the post and it looks fine. 2. I added
   a second post and attached the same image. Now the error happens but the image
   is uploaded successfully and the post after approval seems fine. Just after the
   submission, I hit [https://www.screencast.com/t/4EqBHZQgu](https://www.screencast.com/t/4EqBHZQgu)
   and the url seems fine [http://localhost/wordpress/add-new-post/](http://localhost/wordpress/add-new-post/).
   If I refresh it the submission page is loaded again. My observations so far: 
   If I attached the same image but change the name it is all fine. So there is 
   an issues with same names of the images. Also in the Media tab I have both images
   but the second has no extension and has changed name [https://www.screencast.com/t/LUsyuuNzvHH](https://www.screencast.com/t/LUsyuuNzvHH)
 * Let me know if I can help further
    -  This reply was modified 6 years, 5 months ago by [thema3x](https://wordpress.org/support/users/thema3x/).
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12306132)
 * That is great information thanks. It looks like a bug with files that are named
   the same. Also, for your WP Media settings (under the WP General menu), what 
   do you have for the option, “Organize my uploads into month- and year-based folders”?
 *  Thread Starter [thema3x](https://wordpress.org/support/users/thema3x/)
 * (@thema3x)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12309112)
 * Hi,
    “Organize my uploads into month- and year-based folders” setting seems to
   be checked, but even with unchecked the error persists. Heve you been able to
   reproduce the case?
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12309415)
 * Okay thanks, will investigate and try to resolve for the next plugin update. 
   In the meantime, if you discover any further/related infos, please let me know.
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12566961)
 * Hey [@thema3x](https://wordpress.org/support/users/thema3x/), just to follow 
   up with this, I’ve been trying to replicate the error but not having any success.
   I’m running the current version of USP on latest default WP install. Trying to
   upload the exact same image in consecutive posts always results in a random string
   appended to any duplicate file names (and no errors).
 * So I’m not sure what’s happening in your particular case, but you may want to
   troubleshoot your plugins and theme, they might be conflicting with image uploads
   somehow. Feel free to post again with any questions, feedback, etc. Always glad
   to help.
    -  This reply was modified 6 years, 2 months ago by [Jeff Starr](https://wordpress.org/support/users/specialk/).
      Reason: adds infos
 *  Thread Starter [thema3x](https://wordpress.org/support/users/thema3x/)
 * (@thema3x)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12597518)
 * Hi [@specialk](https://wordpress.org/support/users/specialk/) ,
    I’m using the
   latest wordpress and just two plugins one of which is the free version of USP.
   Here are the steps I take and the error:  I changed the them and the error persists.
   Can you help me resolve it, please?
 * Update: I checked the files from the error’s folder and saw that they have no
   extension
 * [⌊2020-03-29_12-43-14⌉⌊2020-03-29_12-43-14⌉[
    -  This reply was modified 6 years, 2 months ago by [thema3x](https://wordpress.org/support/users/thema3x/).
    -  This reply was modified 6 years, 2 months ago by [thema3x](https://wordpress.org/support/users/thema3x/).
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12598548)
 * Thanks for the great feedback, videos and such. The reported issue does not happen
   on default WP, so there is not much I can do. If you can replicate the issue 
   on default WP (i.e., no other plugins, using the default theme, default settings,
   etc.), then I can replicate the issue and try to troubleshoot and resolve.
 * Also here are some things to try:
 * – Disable ALL other plugins and try again with USP
    – Switch to the default WP
   theme and try again – Try deleting and then reinstalling USP
 * Hopefully something clicks. Again, I want to help, but need to be able to repeat
   the issue on default WP in order to investigate.
 *  Thread Starter [thema3x](https://wordpress.org/support/users/thema3x/)
 * (@thema3x)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12599227)
 * Do you know how can I switch back to default theme again?
 *  Plugin Author [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * (@specialk)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12599281)
 * Visit Themes in the WP Admin Area. If you don’t see any default WP theme, you
   can install it by clicking Add New and then typing Twenty Twenty or Twenty Whatever.

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

The topic ‘Error when uploading same image twice’ is closed to new replies.

 * ![](https://ps.w.org/user-submitted-posts/assets/icon-256x256.png?rev=2567685)
 * [User Submitted Posts – Enable Users to Submit Posts from the Front End](https://wordpress.org/plugins/user-submitted-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-submitted-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-submitted-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/user-submitted-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-submitted-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-submitted-posts/reviews/)

## Tags

 * [usp](https://wordpress.org/support/topic-tag/usp/)

 * 10 replies
 * 2 participants
 * Last reply from: [Jeff Starr](https://wordpress.org/support/users/specialk/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/error-when-uploading-same-image-twice/#post-12599281)
 * Status: resolved