We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36528
    • 3 Posts
    I didn’t find any option to exclude filenames with a dot in the front of the name, so I made a little change in the code of the file "assets/snippets/filedownload/filedownload.class.inc.php".
    In line number 402 I changed the code
    $validFile = $this->_config['filterExt'] ? $this->validExtension($extension) : 1 ;
    to
    $validFile = $this->validFilename($file) && ($this->_config['filterExt'] ? $this->validExtension($extension) : 1 );
    , in line number 408
    $validFile = $this->_config['filterExt'] ? $this->validExtension($extension) : 1 ;
    to this
    $validFile = $this->validFilename($file) && ($this->_config['filterExt'] ? $this->validExtension($extension) : 1 );
    and added in line number 297 this little function:
    function validFilename($filename) {
     if ( $filename[0] === "." ) {
     return 0;
     } else {
     return 1;
     }
    }

    Could this or something like that be added to the next version update?
      • 35986
      • 46 Posts
      Hi. First of all, great snippet. I don’t know whether this was already addressed but I was wondering how I would go about creating a TV based on FileDownload so that my client could specify a file URL in each document that uses a FileDownload snippet call in its template. Is this possible? My client will be regularly generating pages that will each have download links, and i don’t want the client to be constantly editing chunks for each of these pages. Hope this makes sense. By the way, I don’t need the files to be secure so I’d appreciate an answer that didn’t require that I use the FileDownload plugin. Thanks.