Hi 

I use fr document management application with filename und mime-type stored
in a database:

 The queryname is to the database is getFilename

<!--- slash fuer os --->
<cfif findnocase('Windows',server.os.name)>
        <cfset slash = "\">
<cfelse>
        <cfset slash = "/">
</cfif>


<!--- filename zurueckaendern --->
<cfscript>
        // replaces underscore in the stored filename with spaces
        orgname = replace(orgname,'#chr(95)#','#chr(32)#','all');
        // get path
        pfad = ExpandPath('file_f8/' & slash; 
        // full path for file
        file = pfad & getFilename.file_name;
</cfscript>


<!--- download nach passwortcheck ... --->

<cfif len(pwok)>
        <cfheader name="content-disposition" value="attachment;
filename=#orgname#">
        <cfcontent type="#getFilename.doc_mimetype#" file="#file#"
deletefile="no" reset="yes">
</cfif>


Works well for me
Daniel Schmid


> -----Urspr�ngliche Nachricht-----
> Von: Kevin Roche [mailto:[EMAIL PROTECTED]]
> Gesendet: Mittwoch, 26. Juni 2002 13:10
> An: Fusebox
> Betreff: FW: Mime types for file download
> 
> -----Original Message-----
> From: Kevin Roche [mailto:[EMAIL PROTECTED]]
> Sent: 25 June 2002 17:48
> To: [EMAIL PROTECTED]
> Subject: Mime types for file download
> 
> 
> Hi,
> 
> I am trying unsucessfully to create a text file that is downloaded to the
> users machine (with IE 5 browser).
> 
> I just get the text displayed in the IE window which is is not what I
> want.
> I am trying to get a dialog box to display asking for the
> directory/filename.
> 
> I have tried the following
> 
> 1  <CFHEADER Type="application/octet-stream">
> 
> 2  <CFHEADER Type="application/x-msdownload">
> 
> 3  <CFHEADER Type="text/plain">
> 
> All have the same effect.
> 
> In NS 4.7 the top two will create the dialog as required but not in IE
> 
> I also tried setting the header with:
> 
> <CFHEADER Name='content-type' Value='application/octet-stream'>
> <CFHEADER Name='content-disposition' Value='Attachment:
> filename=#filename#'>
> 
> I also tried appending the filename (file.dat) to the end of the URL.
> 
> Still no luck...
> 
> Anyone know why ?
> 
> Kevin
> 
> 
> 
______________________________________________________________________
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

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to