Skip to main content
Participant
September 9, 2011
Answered

how does one control the default filename when forcing a file download?

  • September 9, 2011
  • 1 reply
  • 421 views

I'm running CF9 64bit enterprise using IIS6 and windows server 2003.

I've written a dropbox program that allows users to upload/download files to/from a dropbox folder on the server.

I force a download dialog box  with

     <cfcontent

          type="application/x-download"

          file = "some filename in the dropbox folder">

The dialog box opens but the default download name is the name of my cfm file ('dropbox-download.cfm'), not the the name of the requested file.

The download works but unless the user explicitly renames the file before saving, the application will save the file on their local machine as 'dropbox-download.cfm'.

How does one default the, 'dialog box save as name', to be the actual name of the requested file?

    This topic has been closed for replies.
    Correct answer -__cfSearching__-

    The content-disposition header can be used to specify the file name. You can find several examples in the cfcontent documentation (see bottom of page)

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c82.html

    1 reply

    -__cfSearching__-Correct answer
    Inspiring
    September 9, 2011

    The content-disposition header can be used to specify the file name. You can find several examples in the cfcontent documentation (see bottom of page)

    http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7c82.html