cfcontent - help please

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default 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 selects the month in which the article corresponds to I want the
    text from the article to be displayed in a cfm page so that the user can read
    it.

    example
    archive page
    months - october november december
    choose - october
    october 's article is displayed.

    I tried to do this using cfcontent and below is my attempt - things are not
    working well please help

    <cfif isdefined("id")>
    <cfif isnumeric(id)>
    <cfquery name="qGetItem" datasource="#application.ds#">
    SELECT *
    FROM oshimi_products
    WHERE frn_category_id = frn_category_id</cfquery>
    <cfif qGetItem.recordcount gt 0>

    <table class="symtable"width="360px" >

    <cfoutput query="qGetItem">
    <tr>
    <td>#ProductName#</td>
    </tr>
    <cfheader name="content-disposition"
    value="attachment;filename=ProductDescription_#qGe tItem.ProductDescription#.doc"
    >

    <cfcontent type="application/msword"
    file="#ExpandPath(".")#\ProductDescription_#qGetIt em.ProductDescription#.doc"
    deletefile="yes">
    </td>

    </cfoutput>
    </table>
    </cfif>
    </cfif>
    </cfif>

    message : cant find web page -
    I used eascfm tutorial - [url]http://tutorial217.easycfm.com/[/url]
    Thank you

    quiero mas 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
      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>...
    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 Re: cfcontent - help please

    Are you sure that you are not mixing apples with oranges? You state that "In my
    database there is a field which has links to articles...", so my question is
    are these "links" as in tHTML, or as in file system/directory locations on your
    server? In other words, what is the typical value of
    #qGetItem.ProductDescription# ? Your ExpandPath() function will give you the
    absolute physical directory path, including the drive, to your "current"
    directory, so if you are looking for a "link" instead, you maybe looking in the
    wrong place.

    Phil

    paross1 Guest

  4. #3

    Default Re: cfcontent - help please


    Sorry Everyone who has been helping
    I haven't been very clear

    I want to pull a lot of text which is stored in the database and display it in
    the body of the browser.
    Currently what seems to be happening with the code below is that it opens ms
    word. I know i have that designated but how do i do what i want to do?
    I want to make an archive of articles. When the user clicks on the article
    they want o read it is displayed in the browser as part of the web site.

    I have file name as text.doc but there are more than one file.




    search page

    <cfquery name="qGetCategories" datasource="#application.ds#">
    SELECT id, name
    FROM Oshimi_categories</cfquery>

    <cfif qGetCategories.recordcount>
    <cfoutput query="qGetCategories">
    <b><a href="oshimi_categoryDetail.cfm?id=#id#">#name#</a></b></cfoutput>

    <cfelse>
    <br><font size=2 face="arial">no articles available.</font>
    </cfif>



    result page

    <cfquery name="qGetItem" datasource="#application.ds#">
    SELECT *
    FROM oshimi_products
    WHERE frn_category_id = frn_category_id</cfquery>

    <cfcontent type="application/vnd.ms-word" >
    <cfheader name="Content-Disposition" value="attachment;
    filename=persimmon.doc">
    <cfoutput query="qGetItem">#qGetItem.ProductDescription#</cfoutput>

    quiero mas 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