Menu Content

Support

> Forums, FAQs & Paid Support
Welcome, Guest
Username Password: Remember me

Joomdoc does not delete files on server-side
(1 viewing) (1) Guest
Document management system (DMS) component for Joomla!

If your topic falls within one of the subcategories, then please post it directly there. Post to this parent category only if your question does not match any subcategory topic.
  • Page:
  • 1

TOPIC: Joomdoc does not delete files on server-side

Joomdoc does not delete files on server-side 14 years, 5 months ago #8677

Hi all,

I have the following problem: when i delete a document, joomdoc doesn't delete the file on the server. I had the same problem with Docman and the only way to solve it was modifying the code. I understand that the docman let the user to assign many documents to the same file, but my customer need to handle a 1 file -> 1 document mapping. How can i modify Joomdoc code so that when a document is deleted, also the file on the server is deleted ??

Thanks in advance

Best Regards
Alessio
The topic has been locked.

Re:Joomdoc does not delete files on server-side 14 years, 5 months ago #8715

Hi,

in the meantime I found a solution :).

Open the file document.php located in

<site root>/components/com_joomdoc/helpers

then add the following code

$database->setQuery("SELECT dmfilename FROM #__joomdoc WHERE id='" . $database->getEscaped($uid) . "'");
$result = $database->loadResult();

if ($database->getErrorNum()) {
echo $database->stderr();
return false;
}
$file = JPATH_ROOT . "\\joomdocs\\" . $result;
if (!unlink($file)) {
DocmanHelper::_returnTo('cat_view' , _DML_ORPHANS_PROBLEM , $doc->catid);
}

before

$doc->remove ( array ($uid ) );

in the funcion "deleteDocument"

Any suggestion that can optimize the previous code, or to correct any problem that the code can cause, is welcome ^^

Best Regards
Alessio
The topic has been locked.
  • Page:
  • 1
User Login Empty