Download & Extend

Upload a file with the same name doesn't remove the old upload

Project:Private Upload
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (duplicate)

Issue Summary

If I delete a private file attachment then the tuple related to this attachment is not deleted from the "files" tuple in the drupal database.
Therefore when I upload a different file (different size) with the same name (and then with the same oath, private/nameOfFIle), drupal uses the old tuple (old size). If I download the new attachment this module will use the old size and then the download will be incorrect.

Comments

#1

Version:5.x-1.0-rc2» 6.x-1.x-dev

I can confirm this bug is also critical in the D6 version. I've finally tracked it down to this module.

To reproduce: Upload a private file. Edit the node and delete the private file. Add a new private file with the same filename (but different file). You will now have two entries in the files table for the two files but using the same filepath. When you download the new file it will only be the filesize of the first file (causing unreadable files etc).

I will work on a fix for the latest dev.

#2

Priority:critical» normal

Actually I can't reproduce this problem after all. I have legacy entries in the files table that causes this problem but they are all several months old and likely were caused in relation to the migration into private upload module (which we did custom).

#3

Status:active» closed (duplicate)

Ok, what I was able to reproduce was a duplicate of #277692: Private upload automatically replaces files instead of renaming them - files with the same filename aren't renamed. Therefore if you upload two files with the same filename you will end up with only one file but two different entries in the files table. If the file has changed this can result in either serving the wrong file or serving a corrupt (truncated) file.