kentico_mirekr
-
1/12/2010 6:44:56 AM
RE:GetAtachment, force download
Hi,
You can change the Kentico CMS default behavior in ~\CMSPages\GetFile.aspx.cs file which is responsible for sending the file data to browser.
You may need to modify SendFile(CMSOutputFile file) method like this:
1) please find line about 360:
SetDisposition(file.Attachment.AttachmentName,file.Attachment.AttachmentExtension);
and comment it out.
2) now you need to add some information to header. Please add following line:
Response.AddHeader("Content-Disposition", "inline; filename=<your file name>");
Please note: Some browsers have their own settings how to handle certain documents so in that case this solution doesn't need to work properly.
Best regards, Miroslav Remias.
|