• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfcontent and MIME types for MS outlook .MSG format

New Here ,
Nov 25, 2010 Nov 25, 2010

Copy link to clipboard

Copied

Hi

I am using a web service that returns the contents of a MSG file as a binary string.

I was hoping to use <cfcontent> to then be able to render the document on demand when the user required.

(e.g.)

<cfcontent type="application/vnd.ms-outlook"><cfoutput>#tostring(structDocument.filecontent)#</cfoutput><cfabort /> 

However whenever I try to do this a dialogue box appears asking me to save or open the .cfm file instead of rendering the document like it would for the other file types.  Opening the .cfm file, I can see that the content is pretty much intact. 

(e.g.)

<cfcontent type="application/pdf"><cfoutput>#tostring(structDocument.filecontent)#</cfoutput><cfabort /> 

WORKS

Does anyone have any ideas? 

Thanks

Views

2.0K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Nov 25, 2010 Nov 25, 2010

Copy link to clipboard

Copied

It's nothing to do with the MIME type, you just need to specify the name of the file.

Have a look @ <cfheader>

--

Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 25, 2010 Nov 25, 2010

Copy link to clipboard

Copied

LATEST

Hi Adam,

In the end, the only way that I could get it to work in all browsers was to create a temporary file.  However, the cfheader info was useful, so thanks.

Michael

Code I used:

<cffile action="write"

file="#GetTempDirectory()#/#varFileName#"

        output="#structDocument.Filecontent#"

>

<!--- Output doc --->

<cfheader name="Content-Disposition" value="#var_content_dis#">

<cfheader name="Content-Length" value="#var_content_len#">

<cfcontent type="#var_content_type" file="#GetTempDirectory()#/#varFileName#">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation