1

I have a content type and it has an image field. I'm using the File Field Paths module for the image field.

I uploaded images for some nodes via Drupal interface but then deleted them via FTP.

Then I'm trying to re-upload images to these nodes via Drupal but it gives this error and couldn't find anything to solve the problem.

enter image description here

How can I solve this problem via Drupal or via PHPMyAdmin etc.?

1

Try the Upload QC module. Some details about it (from its project page):

This module offers checks and validations for the process of uploading files. It extends the Drupal 7 core and helps avoid errors during file upload. You can now say good bye to PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 2: INSERT INTO {file_managed}.

WHO SHOULD USE

This module is for you if:

  1. you run into errors like this one PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '' for key 2: INSERT INTO {file_managed} OR PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ... for key 'uri': INSERT INTO {file_managed}.

  2. you would like to add additional file upload validations that check for (a) file name length, (b) file name containing certain words/characters, (c) file name not containing certain words/characters.

  3. Drupal and/or PHP upload size limit is not working for you and you would like to set it yourself in your admin section.

Looks like item "1." is pretty close to your issue, no?

  • Sorry for late reply. I will try this module in a dev site and share the result. I couldn't use it in the live site because its "redness". Thanks. – herci Nov 23 '15 at 12:06
  • No problem for being late, and of course such kind of experiments better happen in a DEV site (just curious if you'll be able to recreate the problem there to start with). Anyway, keep my updated after you had a chance to look at it ... – Pierre.Vriens Nov 23 '15 at 12:09
  • 1
    Did you ever have a chance to try this? – Pierre.Vriens Feb 2 '16 at 19:47
  • Yes I tried it but didn't work for me, unfortunately. I had to clear the related databases manually. – herci Feb 3 '16 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.