title: How can I protect a binary file for being downloaded from a web folder?
body: <p>I am working on a CMS template generator. The users will download the generated template and they will use it on their web server. The template contains a binary file with all important data needed if a user wants to restore the template in the template generator for further changes.</p>
  
  <p>If somebody can download this file, basically, can stole the template. How can I protect this file for being downloaded?</p>
  
  <p>Var. 1:  .htaccess</p>
  
  <p>How safe is to use .htaccess? I'm thinking that sometimes, when copying the files it my be lost (being a hidden file on UNIX like platforms) or it may not work on some servers (other than Apache).</p>
  
  <p>Var. 2: .php extension</p>
  
  <p>I was thinking to use .php extension, forcing the web server to parse the content (if somebody tries to access the file directly). Could this be a reliable solution?</p>
  
  <p>Do you know another way?</p>