using getURL with cfcontent and Excel files

Ask a Question related to Coldfusion Flash Integration, Design and Development.

  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 document 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 document opens as requested (again, after dialog box)

    However, I need to use the Flash Form.

    Has anyone experienced this before?

    Thanks.


    saintsilver Guest

  2. Similar Questions and Discussions

    1. Problems downloading Excel by using cfcontent andcfheader tags
      I have a flash button which using getURL lauches the export of some data in Excel format. This works greate in Mozilla. But IE-6 displays typical...
    2. Cfcontent issue with sending data to excel over https
      Iam trying to send some output data to excel sheet using cfcontent over https. but it doesnt seem to work properly due to an issue of CFCONTENT over...
    3. a Popup that has content type of excel is disappearing,only when created with getURL actionscript command
      Hello, I am new to Flash and ActionScript, so please excuse me if this is something simple. I am a coldFusion developer using some of the new...
    4. Create Multiple Sheets in Excel with CFCONTENT
      Hello, I am able to create an Excel Workbook using the CFCONTENT tag, but am wondering what is the secret to having multiple sheets within the...
    5. 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 =...
  3. #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

  4. #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 document (<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

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