Hi guys, installed Download Lists and set it all up - no problems there at all - however, when I click on a filename from the list, the file is not found.
If I go to File Manager and find the URL for that file - its there, Ok your code is using the var getDownloadURL which I appreciate is different.
How/where is the getDownloadURL generated as I'm quite happy to have a look at this myself - although I have a suspicion that something is not setup correctly somewhere, as the standard C5 download block also has the same problem ie: the files aren't found.
The URL is generated properly and the code here is pretty simple, so I'm sure this is not the code to check. I think the 'download_file' single page should be investigated: /concrete/controllers/download_file.php
publicfunction view($fID=0,$rcID=NULL){// get the blockif($fID>0){$file=File::getByID($fID);if($file){$fp=new Permissions($file);if(!$fp->canRead()){returnfalse;}// if block password is blank downloadif(!$file->getPassword()){return$this->download($file,$rcID);}// otherwise show the form$this->set('rcID',$rcID);
publicfunction view($fID=0,$rcID=NULL){// get the blockif($fID>0){$file=File::getByID($fID);if($file){$fp=new Permissions($file);if(!$fp->canRead()){returnfalse;}// if block password is blank downloadif(!$file->getPassword()){return$this->download($file,$rcID);}// otherwise show the form$this->set('rcID',$rcID);$this->set('fID',$fID);$this->set('filename',$file->getFilename());$this->set('filesize',filesize($file->getPath()));}}}
Maybe the file permissions don't allow to download the file?
If you want us to investigate the issue, please PM me FTP access details and I will perform troubleshooting on your website.
Thanks for the reply Denis, much appreciated, I'll take a look in the morning, in the mean-time I just swapped the var to getRelativePath which just means the user has to right-click to download - my business partner was more than happy with this, so we at least have a work-around.
Thanks again
Code
Post Reply
Delete Post
You are allowed to delete your post for 5 minutes after it's posted.
The URL is generated properly and the code here is pretty simple, so I'm sure this is not the code to check. I think the 'download_file' single page should be investigated: /concrete/controllers/download_file.php
Maybe the file permissions don't allow to download the file?
If you want us to investigate the issue, please PM me FTP access details and I will perform troubleshooting on your website.
Best regards.
Denis Vlasov
Smart Web Projects