I am trying to use CFContent to serve up files for downloading.
I have various of file types ranging from TXT, XLS, EXE, ZIP, and DOC files.
EXE and ZIP files are working correctly.
However if I use TXT, XLS, and DOC files, they will be opened in the browser
or I get a message of:

============
HTTP Error 405
405 Method Not Allowed

The method specified in the Request Line is not allowed for the resource
identified by the request.
Please ensure that you have the proper MIME type set up for the resource you
are requesting.

Please contact the server's administrator if this problem persists.
============

I have XLS as :  xls - application/vnd.ms-excel
I have DOC as: doc - application/msword
I have TXT as: txt - text/plain

Do you think I should change those MIME Types to exe -
application/x-msdownload.
Or is there a better way?

Please see the code below:

First Page for displaying Download Button: This file works fine.
Query DOES exist just not displaying Query.

     <cfoutput query="supportfiles">
      <tr>
       <td>#file_topic#</td>
       <td>#file_Desc#</td>
       <td align="center">
          <form action="support_file_download.cfm/#file_name#.exe"
method="post">
         <input type="hidden" name="filename" value="#file_name#">
         <input type="submit" value="Download File" style="font-weight:
bold;">
        </form>
       </td>
      </tr>
     </cfoutput>


Second File:  CF_Mimetype ( Custom File to get Mime Type from Database ):
This file works fine.

<cfset #ext# = #reverse(spanexcluding(reverse(attributes.file),"."))#>
<cfquery name="GetMimeType" datasource="mime_types"
 sql="SELECT type FROM mime_types WHERE ext = '#ext#'">
<cfif #getmimetype.recordcount# is 0>
 <cfset #caller.mime# = "unknown">
<cfelse>
 <cfset #caller.mime# = #getmimetype.type#>
</cfif>

support_file_download.cfm
This file gives error or downloads EXE and ZIP files:

<cfset filename = "D:\Docs\Secure\Support\#filename#">
<CF_MimeType FILE="#filename#">
<cfcontent type="#mime#" file="#filename#" deletefile="No">



------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to