implementing a file deletetion function
<p>I have a system, where users (even public) can upload *.pdf files,now I want to implement a feature which provides the ability to delete the uploaded files. </p>

<p>This is what I have in mind :</p>

<ul>
<li>create an unique delete hash for each file
and store it in database ( associate
it with unique id of each file )</li>
<li>Generate and display the  delete url
to the user who has uploaded the file</li>
<li>When the delete url (Along with id
and hash ) is called, check if the
delete hash matches with the id</li>
<li>unlink the file </li>
</ul>

<p>is this system ok ? 
I just want to make sure the user can delete only the file which he has uploaded , but not other files.</p>

<p>Thanks</p>

<p>Edit :
Please suggest me a method to create a hash , which cannot be guessed .</p>
