Hi everyone,
don’t know if there is still someone around here? Anyway, I’ve begun using MODx some time ago and have almost finished making my site. Now I’ve come to the point where I’d like to archieve the following:
- I have a customers’ area (login and password required) where I want to provide the bill, the project files etc. as downloads.
- If the absolute path to a file is known, it could of course be downloaded, no matter if logged in or not. So I’d like to restrict those downloads from users that do not belong to a certain user group ("customers").
So if I am not totally wrong here, FileDownloadPE seems to be the solution for what I am trying to do, right?
I’ve tried to set everything up in the way described on Scotty’s site (besides: thanks for your efforts!!). The link shown in the browser’s status bar looks like I suppose it to (e.g. the file’s location is obscured).
BUT NOW MY PROBLEM(S):
1.) When downloading the file (a ZIP file containing two PDFs in this case), its size is just 249 bytes, called "download.zip" (which is the name I want it to have); opening it as ZIP shows an error; opening it with a notepad shows the following error message (including the HTML tags, but without the quotes):
"
<b>
Parse error</b>
: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or ’}’ in <b>/www/htdocs/w00975ed/website/manager/includes/document.parser.class.inc.php(769) : eval()’d code</b>
on line <b>
45</b>
"
So not the file gets downloaded, but this error message. Why is this?
2.) The MIME type either does not get passed correctly (I’ve set it to "application/ZIP", but Firefox tells me the file-to-be-downloaded is a text file) or -- since in fact it is really only text (e.g. the error message, see above) -- gets overwritten somehow.
I’m stuck here. Does anybody have a clue what I might be doing wrong here? (Besides, If I leave the "!" out in my snipped call -- e.g. not [[!FileDownloadPE!]] but [[FileDownloadPE]] -- I get the error message directly in my website rather than in the downloaded file.)
Some background info: Windows XP Pro SP3 | MODx 0.9.6.1p2. I’ve also tried not to bind the download to a certain user group -- still no luck. I am using friendly URLs (with empty suffixes). I have a multi-language site, so the structure is with three main folders that get parsed like: mysite.com/
de/welcome, mysite.com/
en/welcome and mysite.com/
pl/welcome.
Any help would be greatly appreciated by a MODx newbie trying to learn
Thanks in advance, Ruceb
--------
Edit: I’ve just realized that the above described behavior (downloading the error message as text) only occurs as long as I am logged in at the MODx system as administrator. As soon as I am logged out, clicking on a link simply downloads an empty file (0 bytes).