#1917 Wiki attach: same file on different page collides

All_versions
open
nobody
5
2012-12-08
2005-03-25
Brooks Graham
No

I stumbled across some unexpected behavior: attach the same file
to two different wiki pages then delete it from one. It will be
inaccessable from the other - though listed in the attachments for
that page.

In this instance of Tiki 1.8.5, our files are stored in the filesystem
and not in the database. It appears that the filename that gets
created is a hash of the contents so that when it gets uploaded the
second time, it simply overwrites the previous. This is great to
eliminate duplicate files, but without some form of reference
counting, it's causing this problem. I would hope that the physical
file would only get deleted when the last reference to that file is
deleted.

Discussion