Files not being found

Permalink
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.

Any help would be massively appreciated.

Clive

Tags:

View Replies:
smartwebprojects replied on at Permalink Reply
smartwebprojects
The getDownloadURL function is defined in /concrete/models/file_version.php

public function getDownloadURL() {
      $c = Page::getCurrentPage();
      if($c instanceof Page) {
         $cID = $c->getCollectionID();
      } else { 
         $cID = 0;
      }
      return BASE_URL . View::url('/download_file', $this->getFileID(),$cID);
   }


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

public function view($fID = 0, $rcID=NULL) {
      // get the block
      if ($fID > 0) {
         $file = File::getByID($fID);         
         if ($file) {            
            $fp = new Permissions($file);
            if (!$fp->canRead()) {
               return false;
            }
            // if block password is blank download
            if (!$file->getPassword()) {
               return $this->download($file,$rcID);         
            }
            // otherwise show the form
            $this->set('rcID',$rcID);


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
clivep replied on at Permalink Reply
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