I noticed that if user uploads a file with an existing filename to a new node either Private upload module or Drupal filesystem gets confused and attachments get messed up.

First we have Node A with attachment "ATT_file_001.pdf" which has a file -id 3 in files-table

Then we create new Node B with attachment with same filename "ATT_file_001.pdf" which should get file -id 4 in files-table

After submitting there is only one file in private-directory and also only one row for this particular file in database. User gets an error message about it but can not correct it anymore - and attachment looks to be ok. Result is that attachment of Node B points to a wrong file. If user tries to remove attachment pointing to a wrong file, the file will be removed from the filesystem also.

I do not know if this is feature/bug of Private Uploads or Drupal filesystem, I'll try to trace it further a bit later.

Comments

mkque’s picture

I had the same problem. It's a problem in de private upload module. Just check:
http://drupal.org/node/645446

I found a patch in:
http://drupal.org/node/277692
At #4

After editing the private upload module it works fine. If you upload a file with the same name "_1" or "_2" ect. will be added to the file name (just like in case of an normal uload) so the earlier file will not be overwritten.

rpsu’s picture

Status: Active » Closed (duplicate)