Am setting up a preview window for a client's mailDownLoad directory--so can
view actual items, not just a list of them.
Using CFMX

Am accessing this preview template via a form select which shows all files
in
directory--desired one to preview page sent as "Attach".

On preview page, determine type of file by parsing the extension, as doc,
pdf, jpg, etc:

then use the attach's extension to get the type for cfcontent

Sample code

<CFSet theFile = Attach>
<CFSet ext = LCase(ListLast(Attach,"."))>

<CFSwitch expression="#Variables.ext#">
 <cfcase value="doc">
  <CFSet type = "application/msword">
 </cfcase>
 <CFCase value="xls">
  <CFSet type="application/msexcel">
 </CFCase>
 <cfcase value="pdf">
  <CFSet type="application/pdf">
 </cfcase>
 <CFCase value="html,htm">
  <CFSet type="text/html">
 </CFCase>
 <CFCase value="txt">
  <CFSet type="text/html">
 </CFCase>

</CFSwitch>

<CFSet Folder = Request.BasicPath & "MailDownLoads\">
<CFSet FetchFile = Folder & theFile>

then for output:

<cfcontent file="#Variables.FetchFile#" type="#Variables.Type#">

all seems to work fine for pdf and txt and pictures --desired document
opened and shown in adobe, etc.
For doc however, get message that "proper input not received"

for xls, get IE prompt to either download or open file. If choose open,
opens it in Dreamweaver.

I've never used CFContent before, so I assume I'm using it incorrectly, but
don't know where as the pdf and txt work fine.

Appreciate any guidance.

Thanks
Keith Dodd



-
[This E-mail scanned for viruses by declude AntiVirus Software]

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to