Professional Web Applications Themes

Displaying CFM name instead of File name - Coldfusion - Advanced Techniques

I am new to ColdFusion and the following issue has me stumped. I am supporting a site that allows the user to click on a file link and the corresponding application opens and displays the doent. However, the name that is displayed is the name of the CF page, not the name of the file. Using CF Help as well as searching on the internet, it appears that the following code should work: <cfheader name="Content-Disposition" value="inline; filename=#filename#"> <cfcontent type="#cont_type#" file="#file_path#"> For example, for one of the files that is an audio file, I have confirmed that 'filename' = "my_audio.mp3"; 'cont_type' ...

  1. #1

    Default Displaying CFM name instead of File name

    I am new to ColdFusion and the following issue has me stumped. I am supporting
    a site that allows the user to click on a file link and the corresponding
    application opens and displays the doent. However, the name that is
    displayed is the name of the CF page, not the name of the file. Using CF Help
    as well as searching on the internet, it appears that the following code should
    work:

    <cfheader name="Content-Disposition" value="inline; filename=#filename#">
    <cfcontent type="#cont_type#" file="#file_path#">

    For example, for one of the files that is an audio file, I have confirmed that
    'filename' = "my_audio.mp3";
    'cont_type' = "audio/mpeg"; and 'file_path' contains the full path of the
    file. The Windows Media Player opens correctly and plays the audio file, but
    the name that appears is the name of the CF page (i.e. "file_viewer.cfm") This
    also happens for MS Word, MS Excel, and other doents.

    Any suggestions would be appreciated.
    :confused;

    psusemichel Guest

  2. #2

    Default Re: Displaying CFM name instead of File name

    Greetings,
    Did you ever find a solution to this problem. I have the same one, and can't figure it out?

    Thanks,
    Stephen
    Tallahassee, FL
    sbsmithfl Guest

  3. #3

    Default Re: Displaying CFM name instead of File name

    Statement Order is backwards.
    Also, it is better to use "attachment" rather than "inline".

    See
    http://www.macromedia.com/cfusion/webforums/forum/messageview.cfm?catid=3&thread
    id=1074840&CFID=12043549&CFTOKEN=2296d7631db62762-A182FA36-9A2B-E1FB-48C41259DF4
    68A88&jsessionid=96307089776e2e858132#3840761


    MikerRoo Guest

Similar Threads

  1. displaying all file content properly
    By gottagetcodin in forum Macromedia ColdFusion
    Replies: 2
    Last Post: May 13th, 12:05 PM
  2. displaying file list in browser
    By Ken Mosley in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: April 13th, 03:10 PM
  3. QTVR not displaying in .dcr file?
    By r3p00c in forum Macromedia Director Basics
    Replies: 8
    Last Post: November 10th, 07:59 AM
  4. PDF file just displaying black boxes
    By Jonathan_Lewis@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 2
    Last Post: April 13th, 04:38 PM
  5. Displaying Compiled Help file
    By krisrajz in forum ASP Components
    Replies: 0
    Last Post: December 31st, 11:49 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139