Professional Web Applications Themes

using getURL with cfcontent and Excel files - Coldfusion Flash Integration

I'm not sure if this should be a form question, a cfcontent question or a flash question, so I apologize if this is not the proper place to post. Here is the situation: I have a flash form with a cfselect with onchange=getURL('viewFile.cfm?requestedFile=someFi leLocation','_blank') the viewFile.cfm page is: <cfif Right(requestedFile,3) IS "xls" OR Right(requestedFile,3) IS "XLS"> <cfheader name="Content-Disposition" value="inline; filename=Report.xls"> <cfcontent type="application/vnd.ms-excel" file="\myServer\myFolder\#requestedFile#"> </cfif> #requestedFile# is encrypted and decrypted before and after passing the value, but I left that out for simplicity. The result is: Action Canceled Internet Explorer was unable to link to the Web page you requested. The ...

  1. #1

    Default using getURL with cfcontent and Excel files

    I'm not sure if this should be a form question, a cfcontent question or a flash
    question, so I apologize if this is not the proper place to post.

    Here is the situation:

    I have a flash form with a cfselect with
    onchange=getURL('viewFile.cfm?requestedFile=someFi leLocation','_blank')

    the viewFile.cfm page is:
    <cfif Right(requestedFile,3) IS "xls" OR Right(requestedFile,3) IS "XLS">
    <cfheader name="Content-Disposition" value="inline; filename=Report.xls">
    <cfcontent type="application/vnd.ms-excel"
    file="\\myServer\myFolder\#requestedFile#">
    </cfif>

    #requestedFile# is encrypted and decrypted before and after passing the value,
    but I left that out for simplicity.

    The result is:
    Action Canceled
    Internet Explorer was unable to link to the Web page you requested. The page
    might be temporarily unavailable.

    If I hit F5 or click reload, the XLS doent will open (after Open, Save or
    Cancel Dialog Box).

    Any other file type seems to work fine, it is only .xls that is giving me
    trouble.

    If I create the same form as an HTML form using onchange=window.open etc.
    the doent opens as requested (again, after dialog box)

    However, I need to use the Flash Form.

    Has anyone experienced this before?

    Thanks.


    saintsilver Guest

  2. #2

    Default Re: using getURL with cfcontent and Excel files

    Two quick points. "XLS" is same as "xls" in Coldfusion, so no need to compare
    for both. Use absolute path for the file attribute in cfcontent. Something like
    this should work

    <cfselect
    size = "15"
    required = "Yes"
    query = "getData"
    onchange="getURL('somePage.cfm?requestedFile=viewF ile.xls','_blank')"
    value ="id"
    display ="name"
    <option value = "">Select All</option>
    </cfselect>


    somePage.cfm
    ===============
    <cfif Right(url.requestedFile,3) IS "xls">
    <cfheader name="Content-Disposition" value="inline; filename=Report.xls">
    <cfcontent type="application/vnd.ms-excel"
    file="c:/coldfusion8/wwwroot/testfile.xls">
    </cfif>





    BKBK Guest

  3. #3

    Default Re: using getURL with cfcontent and Excel files

    BKBK,

    Thanks again for your help. I think what you are suggesting is essentialy the
    same as what I have after it is processed. The only exception is that my excel
    file is being loaded from a network share rather than from a folder on the C:
    drive.

    What I can't seem to understand is why the similar html version of the form
    works fine, or why the flash form works when requesting a pdf doent (<cfif
    Right(url.requestedFile,3) IS "pdf"> etc.).

    I'll take what you posted and play around a bit an see if I can make it work,
    but please let me know if you know of anything else.

    Thanks

    saintsilver Guest

Similar Threads

  1. Problems downloading Excel by using cfcontent andcfheader tags
    By gumnam in forum Coldfusion Flash Integration
    Replies: 0
    Last Post: September 21st, 04:08 PM
  2. Cfcontent issue with sending data to excel over https
    By purab in forum Coldfusion - Getting Started
    Replies: 1
    Last Post: July 13th, 03:41 AM
  3. Replies: 9
    Last Post: July 11th, 02:22 PM
  4. Create Multiple Sheets in Excel with CFCONTENT
    By SNielsen in forum Macromedia ColdFusion
    Replies: 0
    Last Post: June 20th, 10:56 PM
  5. CFcontent and zip files
    By Ebbey in forum Macromedia ColdFusion
    Replies: 6
    Last Post: April 1st, 02:10 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