Developer forum

Forum » Development » RE: Force .crt files to be downloaded

RE: Force .crt files to be downloaded

Jan Sangill
Reply

Hi,

As an example in php, you can do this in htaccess:

http://css-tricks.com/snippets/htaccess/force-files-to-download-not-open-in-browser/

Is it possible to force a filetype in dynamicweb somehow to always force download, instead of some browsers (firefox) not being able to download .crt files.

In firefox you have to right click, and use "save as"

regards
Jan


Replies

 
Mikkel Ricky
Reply
This post has been marked as an answer

The htaccess settings you refer to tells the web server to use specific mime types for certain file types.

You mention 'right click, and use "save as"' and I assume this means that you're generating a link to the file in a frontend template. Then you can use

/Admin/Public/Download.aspx?ForceDownload=true&File=«filename under /Files/»

to force download of the file (using a Content-Disposition: attachment; header).

Best regards,
Mikkel

 

Votes for this answer: 1
 
Jan Sangill
Reply

Hi Again,

The method you refer to would be a good idea. However in this case, the files is not located on the server itself under files. But on a different server.

WHich again, leads me to ask. Is there some sort of server config that can eb setup to do this?

 
Mikkel Ricky
Reply

You should contact our service desk. They will be able to help you with this.

Best regards,
Mikkel

 
Nicolai Høeg Pedersen
Reply

Hi Jan

If the files are not hosted on the same server as the solution, the service desk cannot help you either. You need to contact who ever host the files because they need to add the mime type to the IIS.

Nicolai

 

You must be logged in to post in the forum