hmm, from what i see, it's looking good.
just one thing might cause trouble (very rarely of course but it could.)
you are using a hash function to decide if an attachment is already in the db or not.
lesson one of hashing is that hashes can be compared faster than the objects, but nevertheless the best hashing function could produce similar hash results with different objects (it's called the birthday problem or something like)
md5 hash spreads the hash result very good, but it is NO injective function, and therfore a bug can occure. (as said rarely but possible)
to solve the problem, you have to compare the full data after selecting it with the hash comparison.
|