hre is my code for deleting a file, wats missing?
$getFields($fields);
$infoFile = $doc->getFileInfo($file);
$title = _l("Delete a document");
if ($action == "dodelete" && $file)
{
if ($doc->hasRight($_SESSION["Sid_user"], "d", $dir))
{
if (!$doc->deleteFile($file))
$error = $doc->errstr();
else
$error = _l("Document successfully deleted !");
}
else
$error = _l("You cannot delete documents !");