You'll need to have a file to link to to link to the file. Obviously. It doesn't need to be different to the page with the link on it, though.
If the page is called, say, "killfile.php", you can have a link there saying
<a href="killfile.php?name=file%2Etxt">Kill file.txt</a>
And in killfile.php, have the code
<?php
if(isset($HTTP_GET_VARIABLES['name']) and ($HTTP_GET_VARIABLES['name']!=''))
{ deletefile($HTTP_GET_VARIABLES['name']);
}
?>
But the whole idea looks awful dangerous as you describe it.