function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
PawelWozniakPawelWozniak 

File is opened instead of download in IE9. servlet.FileDownload problem.

I have a page with a button Create

<apex:commandButton value="Create" action="{!CreateLic}" >

 

and controller which search for specific file then puts it for download.

 

fileURL = '/servlet/servlet.FileDownload?file=' + att.Id; // where att.id is an attachement for a custom object record.

PageReference pr = new PageReference(fileURL);
pr.setRedirect(false);
return pr;

 

File is an binary encypted file with name as xxxx.lic so no text content.

 

This triggers file download dialog for Chrome and Firefox which is correct but Internet Explorer 9 (win 7) is trying to display content on a page it results in lot of characters displayed on the page as shown on image and no download possibility.

 

As an IE is a company standard we nedd to support it.

 

Is there a way to fix that?