I wouldnt call it making it anonymous. However this is database related, well not entirely it can be flat file however the basis on this are a couple of things
The database can do two things
1) Store the files path with a unique identified called a Primary Key.
2) Same thing with the Primary key except store the file in a BLOB.
I dont know of any single scripts which allow for you to do this however there are scripts which contain this. Your better of searching (here on a download script) and learning PHP as well as SQL majority use MySQL, however there are a few who use others.