Force Download option doesn't work

Permalink Browser Info Environment
I checked the box to force download files, but it isn't working. I found the lines in the view.php file that are suppose to cause the force download.

The core C5 has a download.php file that does a force download and I've tried to implement that to get it to download. Using the core download tool downloads the file when I'm logged in, but when I log out, I get an Access Denied message.

I added a table cell at the end of the table and added this line:

<a class="btn btn-primary btn-small" href="<?php  echo $uh->getToolsURL('files/download').'?fID='.$fv->getFileId();?>"><?php   echo t('Download')?></a>


Maybe someone has a suggestion to get this working?

Type: Discussion
Status: Archived
FatTony1952
View Replies:
GregJoyce replied on at Permalink Reply
GregJoyce
Hi Tony,
Looks like you have a couple options here.
If you adjust the file permissions so that the "Guest" group can "search files in the file manager". I just now tested this and it does mean that un-signed-in people can actually hit the file search tool and get results. Not sure if that is ideal.

The other option would be to copy that tool out of concrete/tools/files/download.php up to your_site/tools/get_file.php or whatever. Then you can take out the permissions check in your version of the tool. Alternatively, you can switch that to the canViewFile() permissions check if you want to keep some permissions checking happening.

Really that rule should probably be canViewFile in the core, since the tools/view.php makes that view file check and also renders a button do d/l that file, using the download tool.
GregJoyce replied on at Permalink Reply
GregJoyce
yeah really it doesn't make any sense to rename the tool. Probably just want to go ahead and override.
GregJoyce replied on at Permalink Reply
GregJoyce
One more update - looks like that is already changed in git.
FatTony1952 replied on at Permalink Reply
FatTony1952
Thanks!

Any plans to update the package to clarify and fix that?
FatTony1952 replied on at Permalink Reply
FatTony1952
Do you have a link to the git resource?
FatTony1952 replied on at Permalink Reply
FatTony1952
I've commented out every possible line that has anything to do with permissions and I still get the Access Denied message.
FatTony1952 replied on at Permalink Reply
FatTony1952
Nevermind. Got it.

Had to comment out the line that starts checking for users.

Line 4
$u = new User();
mkly replied on at Permalink Reply
mkly
Hi Tony,
If this isn't already pushed out to the Marketplace I'll get it pushed out soon.

Best Wishes,
Mike
ConcreteCMS replied on at Permalink Reply
ConcreteCMS
Attention: Since there has been no activity on this issue for two weeks, this issue has been automatically archived.

To re-open this issue, reply to this message.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.