Kyle plus all contributors, thank you for a great snippet!
I would like authorised users to be able to delete files from a directory. Authorisation works fine, the delete link shows within the page contents however when clicked, instead of removing the file from the directory I am redirected to the 404 File Not Found page I set up in MODx.
I am running Windows XP with WAMP5 Apache 2.0.58, PHP 4.4.2
MODx 0.9.2.1 with FURL enabled
FileDownload 1.7
The behavior occurs in (Mozilla), FireFox and IE both under PHP4 & 5.
My snippet call: [!FileDownload?getFolder=`assets/docs/short_term_experts` &tplList=`FileDownload` &useHlt=`1` &evenClass=`evenrow` &deleteGroups=`Project management` &oddClass=`oddrow` &imgLocat=`assets/templates/mollio/css/images`!]
Folder name: ’assets/docs/short_term_experts’
File name: ’ste New Text Document.txt’
The ’Delete’ link is associated with the following URI:
http://localhost/aveiro/index.php?q=23.html?act=del&name=23ae44a7bb9263f9076f7c3dbbd48e07
When removing the MD5 from the code the link shows following URI:
http://localhost/aveiro/index.php?q=23.html?act=del&name=assets/docs/short_term_experts/ste New Text Document.txt01154100940
Removing size and time from the URI by changing line 75 in filedownload.inc.php
from:
$files[$fkey]['delete'] = md5($fullpath.$a['size'].$a['mtime']);
to this:
$files[$fkey]['delete'] = $fullpath;
did not help either; still getting the 404 error page. Any ideas what may be going wrong
ps downloads are working no problem!