Professional Web Applications Themes

cfcontent - help please - Coldfusion Database Access

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 * ...

  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. #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

  3. #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

Similar Threads

  1. FLV and cfcontent
    By rbondick in forum Coldfusion Flash Integration
    Replies: 0
    Last Post: August 7th, 09:09 PM
  2. CFCONTENT
    By nix4 in forum Coldfusion - Getting Started
    Replies: 8
    Last Post: July 15th, 03:43 PM
  3. why use cfcontent?
    By Darren in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: May 8th, 01:12 PM
  4. CFcontent and zip files
    By Ebbey in forum Macromedia ColdFusion
    Replies: 6
    Last Post: April 1st, 02:10 PM
  5. CFCONTENT and SSL
    By cmschofield in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: March 2nd, 05:01 PM

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