Jump to content

Recommended Posts

I've placed an htacess file with the code below into my folder with a bunch of artfiles.  I wanted to use it so that when I create an anchor tag and link to one of those files it will download the file.

 

It works like I wanted it to (files download when I click the link); however, I have a page that I created to display some of those files on.  When the htaccess file is in the folder they do not display on this page.  I'm using an img tag or object tag (for swf files).  On this page the files don't show or download.

 

Is there a line of code that will use this for anchor tags only?  Why does this affect the img and object tag?

 

If not, is there a better way to do what I'm trying to do (this seemed so easy)?

 

<FilesMatch "\.(?i:jpg|gif|png|jpeg|tif|tiff|swf|pdf)$">
	Header set Content-Disposition attachment
</FilesMatch>

Link to comment
https://forums.phpfreaks.com/topic/233128-filesmatch/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.