Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default CFCONTENT

    Hello, Is it possible to use <CFCONTENT> within a frame or table layout?
    seems when I run my code (which is a pop up window), the <cfcontent> filles the
    entire window. I'm attempting to include a side bar for glossary terms in the
    pop up window along with the <cfcontent> output. Any suggestions?

    nix4 Guest

  2. Similar Questions and Discussions

    1. FLV and cfcontent
      I've been attempting to use cfcontent to supply an FLV file to a flash application. I can't seem to get it to work. Does anyone have an example of...
    2. cfcontent - help please
      Hi In my database there is a field which has links to articles #productdescription#- these articles have been saved as simple text. When a user...
    3. why use cfcontent?
      Why would one use cfcontent insead of of using cfheader? Sorry if this eems like a daft question but they seem to be the same thing to me.
    4. CFcontent and zip files
      Hi, All I am trying to do is this using cfcontent <cfcontent type = 'application/zip' file = ' E:\Inetpub\staging\TestRoot\test.zip' deleteFile =...
    5. CFCONTENT and SSL
      I've read several online forums concerning the CFCONTENT - PDF problem but haven't seen anything similar to the problem I'm having... I'm...
  3. #2

    Default CFContent

    My project involves the following:

    Customers will create power point presentations and save them as web pages.
    This creates an index file and a subdirectory which has all the supporting
    files (images, javascript, etc). For example, if I have a power point
    presentation with several slides and images, etc, and I call it MyPres, it will
    create a file called MyPres.htm, and a directory called MyPres_files that
    contain all the images, etc. that support the presentation. There is a concrete
    requirement and there is no way around this.

    My question is, all of these files will be stored in web-inaccessible
    directories/subdirectories of the server, for security reasons. I am trying to
    write a cfm page that will display these "PowerPoint Saved As Web Page" pages.

    I have tried using <CFCONTENT> to get the index file, which works fine, but
    none of the links or images display correctly because they are contained in
    subdirectories.

    To generalize this question, how do you display content of not only files, but
    files and their subdirectories to the client without having to put that content
    in a web accessible folder?

    Thanks.

    JeffZzang Guest

  4. #3

    Default CFCONTENT

    I'm using the following code to display a .pdf file in my browser:

    <cfcontent type="application/pdf" file="D:\wwwroot\PDFConvert\temp.pdf">

    this works fine on my development machine, but when i put the code on our
    production machine it does not display the PDF in the browser, instead it pops
    up a box that says

    FileName: file.cfm
    File Type: Adobe Acrobat Control For Active X
    .....

    My thought is something is wrong with the Active X viewer. however if i go
    directly to the pdf using the url in the browser window it displays fine. Any
    thoughts as to what would cause this to happen?

    We are using MX 7, Server 2003, IIS 6

    Thanks


    ladybug Guest

  5. #4

    Default Re: CFCONTENT

    Try using <cfheader name="Content-Disposition" value="inline; filename=#myPDFName#"> instead.

    I haven't had a problem with it.
    cf_menace Guest

  6. #5

    Default Re: CFCONTENT

    no luck. still getting the pop up.

    i'm thinking it might be some kind of security setting on the production server that i can't find. it works fine on my development server though. :-)
    ladybug Guest

  7. #6

    Default Re: CFCONTENT

    if your browser does not understand the mime type definition of "PDF" then it
    will treat it as an unknown file and cause a forced download. Your browser may
    also not have the reader plugin installed on the second machine, but has the
    reader installed on the computer otherwise - this will also cause the browser
    to force a download rather than view inline.

    to start with, try <cfheader name="Content-Type" value="application/pdf">

    next - verify that the PDF reader plugin is actually installed in the browser
    that is causing the pop-ups

    is this second machine possibly a Win98 or earlier OS?



    SafariTECH Guest

  8. #7

    Default Re: CFCONTENT

    the plug in is installed. like i mentioned if i go to the url directly the PDF
    displays just fine.([url]www.mywebserver.com/PDFConvert/temp.pdf[/url]) The code I am
    using works on every machine except when installed our production server. (win
    2003, iis 6 cfmx7) The cfcontent tag acts screwy for all types of files on
    production. it won't display .xls either. I doubled checked and yes it is
    enabled in the coldfusion administrator.

    if i set deletefile="yes" cfcontent does delete the file it just doesn't
    display the file to the browser. so wouldn't that indicate that the tag is
    executing? I'm stumped, my best thought is a security restriction that is set
    on the production server.... i've looked trough IIS and i'm not able to see
    anything that is set differently then the other machines. i'm still working on
    a solution for this!

    ladybug Guest

  9. #8

    Default CFContent

    I'm using CFMX 6.1 and cfcontent to pull a .pdf from a directory to hide it's
    actual location.

    <cfcontent type="application/pdf"
    file="c:\files\filename.pdf" deletefile="no" reset="no" />

    After the user downloads the document, they try and open it in Adobe Acrobat,
    they get the following error message: Adobe Reader could not open
    "filename.pdf" because it is either not a supported file type or because the
    file has been damaged (for example, it was sent as an email attachment and
    wasn't correctly decoded).

    If I download the file directly via ftp, it works fine. Any ideas?

    Muwa Guest

  10. #9

    Default Re: CFContent

    The directory link was wrong. I was also using CFHEADER to force the browser
    to recognize the doc as a pdf and download it. However, since the directory
    was wrong, the file it was downloading, wasn't really a pdf.

    Problem solved.

    Muwa 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