Custom file extensions

Ask a Question related to Coldfusion Server Administration, Design and Development.

  1. #1

    Default Custom file extensions

    I am looking for a way to configure CF to respond to requests with extensions
    other than .cfm
    I found the KB
    [url]http://www.adobe.com/support/coldfusion/adv_development/config_builtin_webserver[/url]
    /config_builtin_webserver05.html about alternate extensions for the built in
    web server, but would like to do the same on IIS.

    Example:
    [url]http://wwwroot/aDocumentForMe.pdf[/url]
    I would like CF to process this with some conditional processing and return a
    custom PDF with <CFDOCUMENT>.

    I've tried using <cfheader name="content-disposition" filename="inline;
    aDocumentForMe.pdf"> in a normal .cfm but Internet Explorer seems to ignore
    this.

    At some point it might be nice to have CF respond with "calculated" .gif files
    also.

    Paul@Boeing Guest

  2. Similar Questions and Discussions

    1. File Extensions - something other than .cfm
      I've run into a good number of MSIE flavors which simply refuse correctly honor the MIME type, and so mapping different extensions to run CF code on...
    2. Add other file extensions for CF to process?
      I want to create something like .jim files that are standard cold fusion files, that are processed by cold fusion. I've tried adding the file...
    3. File extensions
      Everyone I talked to about dds file extensions before I purchased photoshop 7 told me it handled them fine. I can not view or save as for this file...
    4. File Extensions will not save!!!
      When I logoff my system, Windows forgets the file association for a .PDF. I have to manually reset .PDF files to open with Acrobat everytime I login...
    5. File Extensions:save as
      I am running PS7 on WinXP. When I choose 'save as', wanting to, say, save a JPEG as a PSD file, PS is retaining the original extension and then...
  3. #2

    Default Re: Custom file extensions

    <cfheader name="Content-Disposition" value="attachment; filename=""#file_name)#""" />
    <cfcontent type="#file_contentType#" file="#fullPathToFile#" deletefile="No" />

    should work fine.
    paulusje Guest

  4. #3

    Default Re: Custom file extensions

    Yes, thanks.
    That does work but there are still two issues left with this approach:
    1. It brings up an "open or save" dialog.
    2. The URL I need to distribute must end in .pdf

    I need to have ColdFusion parse the CFML in a text file saved with a .pdf
    extension just as if it were a .cfm. There is a way to do it with the built in
    web server. There must be an equivalent technique for IIS.
    I've tried using the "Configuration..." on the "Home Directory" tab of the
    "Web Site Properties" to add an Application Mapping for ".pdf" to
    "C:\JRun4\lib\1\jrun.dll". All that did was send the actual text content to
    the browser window.
    I also tried adding a new <servlet-mapping> to the web.xml file (maybe not the
    CORRECT web.xml file?)

    Any further help is appreciated.

    Paul@Boeing Guest

  5. #4

    Default Re: Custom file extensions

    You have to do as the technote indicates in order for CF to process it once
    your webserver delivers it. To get your webserver to send your extension *.pdf
    to coldfusion you must create a mapping with it. In IIS open the MMC
    properties to home directory. Click configuration. Note the .cfc and .cfm
    mappings. Duplicate them for extension PDF. Confirm no PDF extension exists
    to begin with in the listing.

    ksmith Guest

  6. #5

    Default Re: Custom file extensions

    Most Excellent... works like a charm.

    The strange thing is I had already tried that. As I mentioned in my previous
    post, it didn't work. Your post prompted me to try it again. The only thing I
    did differently this time is restart the whole machine instead of just the
    services.

    Thanks much.

    Paul@Boeing Guest

Posting Permissions

  • You may not post new threads
  • You may 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