User login

Using mod_header to force file downloads

The file_force module offers a solution to the problem of offering download links to nimages and other file types that are otherwise displayed in a browser. As the maintainer of the module states it is not the best solution as it redirects access to static content through a php script. He suggests using a webserver based solution; here is one using Apache's mod_header setting the Content-Disposition header in a given context:

<IfModule mod_headers.c>
  <Location ~ ".*/downloads/.*">
     Header set Content-Disposition attachment
  </Location>
</IfModule>