Php file uploads and prevent duplicates?

Store the MD5 hash (or SHA1) and size of the file in the database. Index the hash.

Store the MD5 hash (or SHA1) and size of the file in the database. Index the hash. To check for duplicates, just search in the database for a file with the same hash and size.

I think that it is too much to create a database for this thing only! Also the database system we have is an old fashioned C-ISAM implementation written by one person that doesn't support concurrent access well. – Parhs Sep 9 at 17:45 I though you had a database for this; I guess a folder with files named after the images' hash would be enough then (e.

G; if (file_exists($hash)) { duplicate(); }) – arnaud576875 Sep 9 at 17:47 I thought of this but they want a human readable name. – Parhs Sep 9 at 17:52 I mean store your images in some directory, and the hash-named files in an other – arnaud576875 Sep 9 at 18:00 hm yes that might be a solution – Parhs Sep 9 at 18:08.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions