2 Replies Latest reply on Sep 14, 2015 10:40 AM by Anthony Harry_773

    a href not working in IE ( Downloading documents )

    Anthony Harry_773

      Hi

       

      This is the portion of code

      <a href="linuxpath/filename.doc">filename.doc</a>

      when I click on filename.doc its asking the option to save in mozilla but in IE its directly opening in browser in bad format .

      The same code is working fine in CF9 , we just installed CF11 in new Linux env and facing this issue

      Can anyone help on this please

       

      Thanks

      Amar

        • 1. Re: a href not working in IE ( Downloading documents )
          WolfShade Level 4

          Instead of linking directly to the file, I'd recommend having the link open a "download.cfm" file, pass an ID or filename as a URL parameter, and use CFCONTENT and CFHEADER to serve the file.  You can set it for inline or attachment - IE will offer you the choice, regardless.

           

          HTH,

           

          ^_^

           

          UPDATE:  Here is how I do it, if you're interested.

           

          <cffile action="readbinary" file="#ExpandPath('./')##filename#" variable="pdfBinary" />
          
          <cfheader name="Content-Disposition" value="attachment; filename=#filename#" charset="utf-8" />
          <cfcontent type="application/pdf" variable="#pdfBinary#" reset="yes" />
          
          • 2. Re: a href not working in IE ( Downloading documents )
            Anthony Harry_773 Level 1

            Thank you for the response .

            I will try to check with your code . But there are many places and we are trying to avoid any coding during this migration , so trying to find out any changes to configuration files  or some patch updates that might be available to resolve this issue