Professional Web Applications Themes

CFcontent and zip files - Macromedia ColdFusion

Hi, All I am trying to do is this using cfcontent <cfcontent type = 'application/zip' file = ' E:\Inetpub\staging\TestRoot\test.zip' deleteFile = 'No'> When I hit the cfm page, I get a dialog box that 'You have chosen to open test.cfm, which is a winzip file.' Its trying to download a cfm file instead of a zip file Is it possible with a zip file? It works for other file types like .doc, .gif, .pdf, .txt, .html etc, when I use the appropriate 'type' value in cfcontent Tx in advance. -e-...

  1. #1

    Default 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 =
    'No'> When I hit the cfm page, I get a dialog box that 'You have chosen to
    open test.cfm, which is a winzip file.' Its trying to download a cfm file
    instead of a zip file Is it possible with a zip file? It works for other
    file types like .doc, .gif, .pdf, .txt, .html etc, when I use the appropriate
    'type' value in cfcontent Tx in advance. -e-

    Ebbey Guest

  2. #2

    Default Re: CFcontent and zip files

    you probably won't be able to open it, but you can try saving it with a .zip extension and see what happens.
    gwgiswebmaster Guest

  3. #3

    Default Re: CFcontent and zip files

    gw, Say I have a test page called test.cfm , which has this piece of code in
    there. If I call an image or a pdf or a word doc, it loads in the cfm without
    any problems. Or in other words, it displays the image or the word doent.
    But when I call the winzip code, I dont expect it to display , but I was hoping
    it would ask 'Do you want to open/save the zip file ' Instead it asks 'You
    have chosen to open test.cfm' -e-

    Ebbey Guest

  4. #4

    Default Re: CFcontent and zip files

    since a browser doesn't have a built in 'viewer' for zip files, this is why you
    are getting the save prompt. I tried my first suggestion to you on my server
    and that worked just fine. If you are bent on having a specific filename
    display instead, you may want to consider storing the file in a SQL database
    with the filename, and use the 'textcopy' command to spit it back out in the
    specified directory with your filename intact. i have code if you wish to
    pursue this route.

    gwgiswebmaster Guest

  5. #5

    Default Re: CFcontent and zip files

    use <CFHEADER NAME="Content-Disposition" VALUE="attachment;
    filename=test.zip"> above your cfcontent tag
    HTH


    --
    Tim Carley
    [url]www.recfusion.com[/url]
    [email]infoNOSPAMINGrecfusion.com[/email]
    Mountain Lover Guest

  6. #6

    Default Re: CFcontent and zip files

    gw,

    Tx for the inputs.

    Could you throw me some more light on how it needs to be done using the sql server ?

    tx much

    -e-
    Ebbey Guest

  7. #7

    Default Re: CFcontent and zip files

    Hey Nu,

    That seemed to have fixed the problem.

    Tx much for the feedback guys,

    -e-
    Ebbey Guest

Similar Threads

  1. using getURL with cfcontent and Excel files
    By saintsilver in forum Coldfusion Flash Integration
    Replies: 2
    Last Post: July 20th, 07:42 PM
  2. CFCONTENT
    By nix4 in forum Coldfusion - Getting Started
    Replies: 8
    Last Post: July 15th, 03:43 PM
  3. Problem using cfcontent to view files??
    By rhileyrmax in forum Coldfusion - Getting Started
    Replies: 3
    Last Post: July 13th, 03:11 AM
  4. why use cfcontent?
    By Darren in forum Coldfusion - Getting Started
    Replies: 2
    Last Post: May 8th, 01:12 PM
  5. cfcontent to deliver files
    By sonicsight in forum Macromedia ColdFusion
    Replies: 1
    Last Post: March 30th, 04:14 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