Using CFCONTENT with Dynamic Variables

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default Using CFCONTENT with Dynamic Variables

    If I hardcode all of the values for a force file download using CFCONTENT, I
    can save the file just fine. But the problem is that I want to reuse the file
    download page to force a file download for more than one file name. When I
    substitute variables for the filename, I get the following error.

    "Complex object types cannot be converted to simple values. "

    The code I am using is:

    <cfset file= "templates.zip">

    <cfheader name="Content-Disposition" value="attachment;filename=#file#">
    <cfcontent file="C:\Inetpub\wwwroot\downloads\#file#"
    type="application/x-zip-compressed" reset="no">

    I am running CFMX7 on IIS5.0 and IE6. I get the same exact error when running
    under Firefox.


    gmahler5th Guest

  2. Similar Questions and Discussions

    1. passing dynamic variables
      Am creating a video library using a database to store the url links to the videos - how do I pass a variable selection from one html page to another...
    2. updating db from dynamic form variables
      I am having a hard time trying to figure out how to update my database from a form of dynamically populated formfields. I searched around and read...
    3. CFLOOP and dynamic variables
      Hi, have a simple problem - and I cannot find a simple answer! I am looping through a list of fields returned from a form. FORM.FIELDLIST via...
    4. Cfcontent and session variables
      Our site allows members to download mpg files through cfcontent. Our basic code is: <CFSET...
    5. Dynamic targets and variables
      I have a variable / movie clip that I am dynamically creating. Lets say: num = 1; And I create a new movieclip like this: ...
  3. #2

    Default Re: Using CFCONTENT with Dynamic Variables

    This is a classic. :-)

    You can't use "file" as your variable name. It's reserved by CF. Change it to something else, for example #myFile#.


    Fernis 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