Flex app calling CF cfc to download file gets "Channel disconnected" fault

I am a newbie with ColdFusion and Flex. I am trying to implement file download/streaming functionality in my Flex 4.5 application and I am running ColdFusion 9 as my back end. More specifically, I have a component in my Flex app that displays a list of files - some of these files can be available for opening (or "previewing") via the client. I want the client to be able to click a button and download the file from the ColdFusion server, after the appropriate security checks are performed (also in ColdFusion). Right now I am just trying to get the basic download functionality to work with a very simple cfc. Here is the cfc code:
<cfcomponent displayname="Preview Document"
     output="false">
     <cffunction name="streamFile" access="remote" returntype="any">
          <cfargument name="filename" displayName="Filename" type="string" required="true" />
          <cfheader name="Content-Disposition" value="attachment;filename=#filename#" >
          <cfcontent type="application/unknown" file="c:\myserverpath\#filename#">
     </cffunction>
</cfcomponent>
When I try this via a cfm, it works fine (I get a File Download window where I can choose to either open or save the file). But when I try to use this in my Flex app, I get an error.
In my Flex app, I have a RemoteObject to access my cfc and a CallResponder:
<s:RemoteObject id="PreviewDocument"
   source="PreviewDocument"
   destination="ColdFusion"
   showBusyCursor="true"/>
  <s:CallResponder id="PreviewDocumentResult"
    fault="Alert.show('CallResponder PreviewDocumentResult: ' +
    event.fault.faultString + '\n' + event.fault.faultDetail)"
    result="PreviewDocumentResult_resultHandler(event)"/>
Then I created a button whose click even executes the following line:
PreviewDocumentResult.token = PreviewDocument.streamFile("myfile.pdf");
When I run my app, I get the following fault:
faultCode = "Client.Error.DeliveryInDoubt"
faultString = "Channel disconnected"
faultDetail = "Channel disconnected before an acknowledgement was received"
I have tried many different approaches and searched online for help with this fault, but I could not find any helpful clue to where I can start investigating this.
Can anyone help with why I am getting this fault?
Thanks in advance.

@sir_teddy, thanks for your reply again.
Yes I have created a simple cfc that returns a string successfully (in fact I had used the same cfc and basically just commented out the cfcontent and cfheader tags, and returned the name of the file being requested in the cfreturn tag). When I un-comment the cfcontent tag from the code, the error comes back.
So I am really at a loss here...

Similar Messages

  • A Flex App in browser is a swf file or translated to Javascript

    A Flex App in browser is a swf file or translated to Javascript?
    Like Flash web site plugins [not whole browser window], exist and Flex plugins?
    These are both swf files only without other supporting files?

    A Flex app is a SWF and is not translated to Javascript.  Many Flex apps do
    use Javascript to handle history management and startup focus.

  • A plug-in for Adobe Color in the app or to allow the download file to be accessed by Muse

    I think it would be awesome to have the functionality of adobe color CC. so that we can search for colors in the app or allow us to download the file drop it into the app for use, so we won't have to screenshot the color and color pick them.

    Acrobat does not have this built in. Normally, the table of contents is prepared at the same time as the document, perhaps in Word, which will use heading styles to do it automatically. Then this is converted to PDF. It is very unusual to do this work late with a PDF, I guess this is why it is not a core Acrobat feature.

  • Why do some downloaded files get "generic" file names?

    Sometimes when I click on a link to download a file the file ends up on my computer with a name corresponding to part of the URL that I clicked on. It only happens when the link doesn't point to a file name but instead calls a serverside process and passes the name/ID of the file to be downloaded. For example, a URL that looked like this:
    http://www.servernamegoeshere.com/digitalAsset/?id=123456 (example - not a working link)
    results in a file named "digitalAsset" on my desktop. I'm sure the issue has something to do with how the file is being sent by the server (HTTP header or MIME info) but I'd like to figure out exactly why that happens so that I can point the server owner in the right direction so that it gets corrected (unless it's a Safari bug). The same ULR works as anticipated in FireFox 2.0.
    Other similar links on the same site that point to PDF files get handled properly (displayed by Safari). The links that don't behave correctly point to Word files.
    Any ideas why this happens?
    MacBook Pro   Mac OS X (10.4.8)  

    Hey there,
    Try this:
    Highlight the tracks in iTunes (hold down the control button to highlight multiple tracks at once) and right-click on them and choose Get Info from the menu. From there, head over to the Options tab. Towards the middle of the window should be a drop down menu for Media type. Choose either audiobook or music, depending on which way you want to organize them. Then hit OK to apply the changes.
    See if that helps.
    B-rock

  • Email and iTunes apps are now in an app called "lifestyle".  How do I get them out?

    email and iTunes apps are in an app called "lifestyle".  Don't know how they got there and want them out.  Help.

    Found the answer in another post.

  • HELP - Downloading File gets header changed

    Hi,
    We got a problem, when downloading a file from a page the file shows up 'inline' the browser but we create de header with Content-disposition: attachment;
    Oracle 10.2.0.3
    OHS
    Apex 3.0.1.00.07
    In our development system it doesn't occur, in one of our clients it doesn't occur, but in two (different) clients it does.
    We have some pages that let the user download some text files (with width fixed columns). In one of this pages the file is being showed by the browser 'inline' like an html file, but to generate this file we use a procedure like this:
    OWA_UTIL.mime_header(l_mime_type, FALSE);
    HTP.p('Content-Length: ' || DBMS_LOB.getlength(l_blob_content));
    HTP.p('Content-disposition: attachment; filename="'||l_name||'"');
    HTP.p('Content-transfer-encoding: BASE64');
    HTP.p('Content-type: application/octet-stream; name="'||l_name||'"');
    OWA_UTIL.http_header_close;
    WPG_DOCLOAD.download_file(l_blob_content);
    in other page that use this procedure too, the download file dialog show up correctly.
    Using FF Live HTTP Headers, i can see the file with problems comes with the 'wrong' header
    HTTP/1.x 200 OK
    Date: Thu, 26 Jun 2008 17:47:01 GMT
    Server: Oracle-Application-Server-10g/9.0.4.0.0 Oracle-HTTP-Server
    Content-Length: 1452
    Content-Type: text/html; charset=ISO-8859-1
    X-Cache: MISS from floyd.infox
    Proxy-Connection: keep-alive
    I debug our procedure inserting the header generated in a table an it's generating correct, with all the options we wanted, i looked around for this issue but didn't find anything. It seems related to OHS, but all OHS (working or not) are configured the same way.
    OHS Error LOG's don't have any information about.
    Anyone have seen this?
    TY,
    Guilherme
    If it's too complicated I could rewrite....
    Message was edited by:
    gfreddi

    nobody can help me?
    This is a serious issue we can lost some clients to this....

  • Flex app behaves differently when Adobe automation files loaded

    We have an application built with Flex 3.1. I am attempting to create QTP tests for this application.  The instrumentation files are loaded at run time, not compiled into the application.
    I am using QTP 9.5 with the Adobe Flex Add-in 3.0.  I am able to see the controls an run tests to some extent.
    The main issue I am trying to resolve is that there is a difference in behavior of the application when it is started with the instrumentation files. The differences occur both inside and outside of the QTP environment.
    The observed differences are:
    The initial page is a login screen. After entering the id and password, I can click ‘Enter’ or click the “Log in” command button. With the instrumentation files loaded, the ‘Enter’ key no longer works.
    When I log out of the application, a progress screen displays while the environment clean-up occurs.  When the progress bar hits 100%, the original login screen is displayed. With instrumentation files loaded, activity stops when the progress bar hits 100% and the original login screen is never displayed.
    After logging in, a window with perspective tabs displays.  Each perspective tab page contains a window containing a list of resource associated with the perspective. When instrumentation files are loaded, the tab pages exist, but the perspective windows are not created.
    I realize I am dealing with application-specific behavior here and I am pursuing this with our developers. What I am looking for is any information related to differences in application behavior when instrumentation files are loaded.

    I can't seem to reproduce what you are seeing with this sample application:
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark">
        <s:states>
            <s:State name="state1" />
            <s:State name="state2" />
        </s:states>
        <s:controlBarContent>
            <s:Button label="change state" click="currentState=currentState=='state1'?'state2':'state1'" />
        </s:controlBarContent>
        <s:Button x="50" y="50" label.state1="state1" label.state2="state2" skinClass="CustomButtonSkin" />
    </s:Application>
    Can you provide a similar sample application that demonstrates the issue?

  • Hi, I downloaded an app called "futoshiki". I need to get some "how to" information about it. It has a name like "Shinchi Nishimori" associated with it. Can anyone help?

    Hi, I dowloaded an app named "FUTOSHIKI". It has the name "Shinichi Nishimori" associated with it. I need to know what the blocks under the top row of numbers with the X's and check marks are used for?  Thanks,GrandpaS

    Contact the developer
    http://www.9bitlabs.com/support.aspx

  • Finder crashes whenever a downloaded file gets chosen to "Show In Finder"

    It happens after some files are downloaded, and it doesn't matter what type of files they are. If there is a folder open on the desktop and the downloads window is open, ctrl + click the file, choose "show in finder" and the folders all reset to show the root (HD and Network). If it is shown again, the entire finder crashes. This happens on every OS X version and hardware type. Anyone else here of this happening? I can't find a single thing to make it work.

    What is in the side panel is just a shortcut.
    The Pictures Folder is in your User Account. IN the Finder use the Go menu and paste this into the window
    ~/Pictures
    and it will bring you there.

  • Parse fieldpoint IAK file -- get channel names and ranges?

    Hello,
    I am looking for a way to read the fieldpoint channel names in their real order (not sorted) _and_ their corresponding range settings from an IAK file. Hardware is a FP-1001 network module connected via RS485 and a handful of AI-110s and AO-210s.
    Has anyone found a way to do so yet?
    Tried the FP get configuration info VI without succes, it sorts the channel names alphabetically. Edited the VI (threw out the sort array funktion), but no success: Channels now are mixed in no sensible way (the documentation confirms this behavior).
    For the ranges, I've looked at the optomux !E, but a) it needs a FP ressource connected (can't work offline this way), and b) I have no clue yet of how to match these ranges with the well-mixed channel names :-(
    Maybe someone here can help?
    Yours, sincerely,
    Sebastian F. Kleinau

    Hi,
    Please take a look at the following knowledgebase:FP Get Configuration Info.vi Returns Values in a Different Order
    I think this is what you are looking for.
    Regards,
    Timo

  • How to use Flex Builders Auto Generated CFCs

    OK. Not only have I already gone to a 4 day flex training,
    have an advanced coldfusion certification and work with 3 coworkers
    who have done the same...none of us can figure out how in the heck
    the flex builder's autogenerated cfc's are to be used. No big deal
    on the fact that this might be something we simply are encountering
    for the first time, but the complete and utter absence of a single
    piece of example code or documentation stating how to use this code
    correctly is very very very very irritating.
    Can anybody, share with me anything about how these CFCs are
    to be used correctly. For example. We are using the wizard to
    generate an "Active Record CFC" set of cfc's for an example table
    contain four fields. We have a data grid that is now populated by
    the "getAllAsQuery" function....we would like to implement the
    feature of making this dataGrid updateable. We know how to pass
    data back and forth and yes we could write our own CFC to do
    this...but having it autogenerated is a really neat option...but
    the question remains....how does one use them!!!
    Any help would be much appreciated. Thanks in advance!

    Hi there, what's your name by the way?
    What is a VO or DTO, and why would you use it?
    This was copy from the Java world, so it's a very OOP principle, basically in the OOP world everything is a class that has methods and properties, and you represent everything with classes, a VO is just that a class that represents an entity in your app. You use it for a few reasons in my opinion:
    It allows you to pass strongly typed data between different layers in your app.
    It's more verbose, it's a good OOP practice, and also makes debugging and reading you code easier.
    It allows easy data type conversion between CF and Flex.
    You obviously know how to use the wizards, after you select your table and open the wizard you'll see three different CFC types, if you're using LCDS then select that type if you don't I'll recommend you to go with BEAN/DAO. In Flex Builder you can create a folder link to a system folder, so if you create a folder named MyCFCs and you set this virtual folder to be hold inside c:\ColdFusion8\wwwroot every file that you put in this folder will be place in c:\ColdFusion8\wwwroot so you don't have to manually copy those files.
    In this wizard you'll see CFC folder in there you can select your virtual folder, you'll see below the CFC package name this is extremely important to be set right, what is the CFC package name? Basically it's the same folder structure where your CFCs will be located for instance let's say you're gonna place the files in this folder structure c:\ColdFusion8\wwwroot\com\myPersonalDomain\ so your CFC package name will be com.myPersonalDomain.
    You'll probably also would like to enable the option: Create an ActionScript value object in addition to CFCs, the folder where you place this file have to mimic the CFCs folder structure so for an instance you'll have to save inside your src folder, inside a folder com, an finally inside a folder myPersonalDomain . src/com/myPersonalDomain, and the AS Package name should be the same as the CFC.
    Once you're done and click finish, you'll see for files created, one of the the AS VO , and three CFCs.
    yourDataTable.CFC
    This is a CFC that creates the VO or DTO in CFC, it has the same properties definition that the AS version has, also the setters and getter for every property.
    yourDataTableDAO.CFC
    This CFC contains all the code that handles the database access it a could be an insert, update delete or just a read query.
    yourDataTableGateway.CFC
    This is a bridge between your Flex app and your CFCs, it contains a set of methods commonly use when you access a DB, this CFC invocates the methods in the yourDataTableDAO.cfc and returns an object or an array of objects of yourDataTable.CFC type to Flex.
    In Flex what do you have to do in order to use VOs?
    Add a reference to yourDataTable.as class
    Create a remote object.
    Create the event handler(s)
    Make a call to the remote object.
    <mx:Script>
         <![CDATA[
                   import com.myPersonalDomain;
                   import mx.controls.Alert;
                 import mx.rpc.events.ResultEvent;
                  private var myDummyVar:myDataTable;
              private function myEventHandler(e:ResultEvent):void{
                   //do Something
                   trace(event.result.toString());
         ]]>
    </mx:Script>
    <mx:RemoteObject id="myRO" destination="ColdFusion"
    source="com.myPersonalDomain.myDataTableGateway">
         <mx:method name="getAll" result="myResultHandler(event)"
    fault="Alert.show(event.fault.toString())" >
    </mx:RemoteObject>
    <mx:Button label="Call CF" click="myRO.getAll()" />
    Well I hope this would help you, I'm kinda tired this has been by far the largest post I've written.

  • Flex App talking to remote LCDS (or blaze or granite) server?

    I've got a Flex app that's running just fine sitting on a Tomcat server, talking to GraniteDS (open source LCDS alternative) that feeds it JMS messages.
    However we're going to need to install the Flex SWF app onto another server entirely (maybe JBoss, who knows) because the SWF actually is just part of the overall web application functionality.
    So is it possible to have the compiled SWF sitting somewhere else other than the LCDS/Granite server?  As I said, when the SWF and the DS server are one and the same, it works fine.  But when I separate the two the SWF app can no longer connect to the DS server (addEventListener returns a Fault).
    There must be some configuration file that the SWF can read at run-time to know what DS server URL to use.  Any ideas?

    One more tidbit.  I modified my services-config.xml and replaced the channel dynamic definition URL that was there (http://{server.name}:{server.port}/{context.root}/gravity/amf) with a hard-coded one http://localhost:8080/gravity/gravity/amf/
    Then I modified my Flex app to no longer try to set the Channel at run time, just to use what's in services-config.xml.  Guess what, it connects just fine.  So the url http://localhost:8080/gravity/gravity/amf/ is absolutely correct - the problem MUST be in the Flex code.  The handler for "MessageFaultEvent.FAULT" keeps firing with the fault from my previous post.
    What about this Flex code is wrong?
    myChannelSet = new ChannelSet();
    myChannel = new AMFChannel("my-gravityamf", "http://localhost:8080/gravity/gravity/amf/");
    myChannelSet.addChannel( myChannel );
    // Define Producer
    producer = new org.granite.gravity.Producer();
    producer.addEventListener(MessageFaultEvent.FAULT, faultHandler);
    producer.addEventListener(MessageEvent.RESULT, faultHandler);
    producer.destination = "messages-destination";
    producer.channelSet = myChannelSet;
    // Define Consumer
    consumer = new org.granite.gravity.Consumer();
    consumer.addEventListener(MessageAckEvent.ACKNOWLEDGE, acknowledgeHandler);
    consumer.addEventListener(MessageEvent.MESSAGE, messageHandler);
    consumer.destination = "events-destination";
    consumer.subscribe();
    producer.send("LOGIN");

  • How to exit a Flex app

    I have a Flex application that is run in a browser.  There is a public page and then other pages that cannot be accessed unless the user logs in.  To log in, I show a popup window and the results of their username, password and role determines which page in a viewstack gets displayed.
    My issue is this.  When the user clicks the logout button, I want the app to go back to the public page as if they just eneterd the application for the first time.  Is there are easy way to accomplish this, and is it secure?  If so, how?
    Thanks again!

    if you wanted to just close the window all together you could write some Javascript to close the window, then in your flex app call the function when they click the logout button
    If you want to actually end it with Actionscript you could try:
    public function applicationExit():void {
         var exitingEvent:Event = new Event(Event.EXITING, false, true);
         NativeApplication.nativeApplication.dispatchEvent(exitingEvent);
         if (!exitingEvent.isDefaultPrevented()) {
              NativeApplication.nativeApplication.exit();
    Source: http://livedocs.adobe.com/flex/3/html/help.html?content=app_launch_1.html

  • Download files and videos

    Hi every one,
    I want best app that allow me to download file and videos vis safari browser
    I found some apps but all of them work out of safari browser.
    And, after some search i found ( safari download manager ) app it's work with safari browser
    But it's available only in sydia . See it :
    http://cydia.saurik.com/package/net.howett.safaridownloader
    Please help, thanks

    Please ask your question on a forum for the Flash Player

  • Problem with downloading file from FTP server

    Hello all
    I have uploaded a file from an application i developed and i want to download this file from another application. The code is
    public static void FTPcon() throws FtpException{
       String hostname = "my.ftp.server";
       String username = "myusername";
       String password = "mypass";
       Ftp ftp = new Ftp(hostname,username,password);
       ftp.setHostname(hostname);
            ftp.setUsername(username);
            ftp.setPassword(password);
            ftp.connect();
            ftp.setBinary();
            ftp.download("file.dat");
            ftp.disconnect();
    }The error i receive is java.io.FileNotFoundException: public.dat (The system cannot find the file specified) but the file is on the server.
    Thanks in advance for any help

    Cotton thank you for your reply
    Any other sugestions please?The server disagrees. So...
    - the file does not existThe file exists.I checked it with an FTP client program.
    - the file has a different nameThe file name is correct
    - you are connected to the wrong serverI am connecting to the correct server
    - you are in the wrong ftp directoryThe file is placed in the home directory
    - the ftp library you are using is broken (less
    likely)I am using the library from jscape.I dont think is broken because i can upload the file from the first application.
    >
    FTP isn't somehow broken in Java. I use it all the
    time. The problem is something listed above. I would
    check all of the first four if I were you because
    that's most likely where the problem is.Message was edited by:
    flightcaptain

Maybe you are looking for

  • Error in parallel exp-imp using ftp method

    Hi, We are doing migration of ERP system running on redhat linux 6 and sybase 15.7 . Trying to do parallel export import using ftp method. Here when we start the export monitor, it gives the below error. Required system resources are missing or not a

  • How to use the mirrored and log shipped secondary database for update or insert operations

    Hi, I am doing a DR Test where I need to test the mirrored and log shipped secondary database but without stopping the mirroring or log shipping procedures. Is there a way to get the data out of mirrored and log shipped database to another database f

  • Workaround for MailTo Yahoo! Mail Helper Application bug?

    I don't know if there is an active bug report for this, but for Firefox 8 with the MailTo Helper Application set to Yahoo! Mail, choosing [i]File: Send Link[/i] opens the Yahoo mail form and inserts [b][i]mailto:?To=[/i]<link>[/b] into the [b]To:[/b]

  • IPhoto 6 issues with perforated box

    I have loaded some pics to experiment with iPhoto, but have encountered some problems. My thumbnails appear fine at the top to the window, but when chosen, the ever ominous perforated box with an exclaimation mark shows up. I saw an earlier comment t

  • Discount Taken report

    I'm looking for a report that shows, by payment run, what discounts were taken and/or missed. Does anyone know an existing report or query that will provide this?