<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:clearspace="http://www.jivesoftware.com/xmlns/jive/rss" version="2.0">
  <channel>
    <title>Adobe Community : All Content - All Communities</title>
    <link>https://forums.adobe.com/</link>
    <description>All Content in Adobe Community</description>
    <language>en</language>
    <pubDate>Mon, 03 Oct 2011 11:37:09 GMT</pubDate>
    <generator>Jive Engage 7.0.0.1  (http://jivesoftware.com/products/)</generator>
    <dc:date>2011-10-03T11:37:09Z</dc:date>
    <dc:language>en</dc:language>
    <item>
      <title>Flex app calling CF cfc to download file gets "Channel disconnected" fault</title>
      <link>https://forums.adobe.com/thread/909187</link>
      <description>&lt;!-- [DocumentBodyStart:87befd73-1d60-4eb9-831a-8f27e4263e3b] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt;"&gt;&lt;p&gt;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:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;cfcomponent displayname="Preview Document" &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output="false"&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cffunction name="streamFile" access="remote" returntype="any"&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cfargument name="filename" displayName="Filename" type="string" required="true" /&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cfheader name="Content-Disposition" value="attachment;filename=#filename#" &amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;cfcontent type="application/unknown" file="c:\myserverpath\#filename#"&amp;gt; &lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/cffunction&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/cfcomponent&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;In my Flex app, I have a RemoteObject to access my cfc and a CallResponder:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt;"&gt;&amp;lt;s:RemoteObject id="PreviewDocument"&lt;br/&gt;&amp;nbsp;&amp;nbsp; source="PreviewDocument"&lt;br/&gt;&amp;nbsp;&amp;nbsp; destination="ColdFusion"&lt;br/&gt;&amp;nbsp;&amp;nbsp; showBusyCursor="true"/&amp;gt;&lt;br/&gt;&amp;nbsp; &lt;br/&gt;&amp;nbsp; &amp;lt;s:CallResponder id="PreviewDocumentResult"&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fault="Alert.show('CallResponder PreviewDocumentResult: ' + &lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; event.fault.faultString + '\n' + event.fault.faultDetail)"&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; result="PreviewDocumentResult_resultHandler(event)"/&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Then I created a button whose click even executes the following line:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt;"&gt;&lt;span style="font-size: 2;"&gt;&lt;p&gt;PreviewDocumentResult.token = PreviewDocument.streamFile(&lt;/p&gt;&lt;/span&gt;&lt;strong style="color: #990000; font-size: 10pt;"&gt;&lt;strong style="color: #990000; font-size: 10pt;"&gt;"myfile.pdf"&lt;/strong&gt;&lt;/strong&gt;&lt;span style="font-size: 2;"&gt;);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;When I run my app, I get the following fault:&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;faultCode = "Client.Error.DeliveryInDoubt"&lt;/p&gt;&lt;p&gt;faultString = "Channel disconnected"&lt;/p&gt;&lt;p&gt;faultDetail = "Channel disconnected before an acknowledgement was received"&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;span style="color: #333333; font-size: 10pt;"&gt;Can anyone help with why I am getting this fault?&lt;/span&gt;&lt;/p&gt;&lt;p style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks in advance.&lt;/p&gt;&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:87befd73-1d60-4eb9-831a-8f27e4263e3b] --&gt;&lt;img src='/beacon?t=1415918213996' /&gt;</description>
      <category domain="https://forums.adobe.com/tags#/?containerType=14&amp;container=1">flex</category>
      <category domain="https://forums.adobe.com/tags#/?containerType=14&amp;container=1">coldfusion</category>
      <category domain="https://forums.adobe.com/tags#/?containerType=14&amp;container=1">file_download</category>
      <category domain="https://forums.adobe.com/tags#/?containerType=14&amp;container=1">channel_disconnected_fault</category>
      <pubDate>Mon, 03 Oct 2011 11:37:09 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/thread/909187</guid>
      <dc:date>2011-10-03T11:37:09Z</dc:date>
      <clearspace:dateToText>2 years 3 months ago</clearspace:dateToText>
      <clearspace:replyCount>7</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
    <item>
      <title>Event trouble - dispatching an event from the main app?</title>
      <link>https://forums.adobe.com/thread/894378</link>
      <description>&lt;!-- [DocumentBodyStart:d4880724-031d-43e7-b9bd-ef5b5b1b6c16] --&gt;&lt;div class="jive-rendered-content"&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;I am new to Flex and recently I am trying to use custom events. Currently I have a custom component that dispatches a custom event when the user clicks a button. That event is being caught and handled in the main app file. That is working fine.&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" style="min-height: 8pt; padding: 0px;" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;&amp;nbsp;&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;Part of this event handling consists of requesting data from a remote server. When the data is returned, I instantiate an object to store it. What I want to do is to pass this object back to the custom component via a custom event that would be dispatched from the main app. Is that possible at all?&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" style="min-height: 8pt; padding: 0px;" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;&amp;nbsp;&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;I am dispatching the custom event but it is not being caught in the custom component, even though I added a listener there via addEventListener (and I create the listening function too).&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" style="min-height: 8pt; padding: 0px;" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;&amp;nbsp;&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;The reason I want to use an event, and not data binding is because I want to be able to do some manipulation/formatting of the data in the object *within the custom component* BEFORE it gets displayed. I don't want to do this manipulation in the main app because it might have to be closely coupled with visual elements in the custom component, and I am trying to keep the business logic separated from the visual and the data (MVC model).&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" style="min-height: 8pt; padding: 0px;" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;&amp;nbsp;&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;Any ideas? &lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" style="min-height: 8pt; padding: 0px;" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;&amp;nbsp;&lt;/p&gt;&lt;p lang="function(){return A.apply(null,[this].concat($A(arguments)))}" ondblclick="" onkeydown="" onkeypress="" onkeyup="" onmousemove="" onmouseout="" onmouseover="" onmouseup="" title="function(){return A.apply(null,[this].concat($A(arguments)))}"&gt;Thanks in advance.&lt;/p&gt;&lt;/div&gt;&lt;!-- [DocumentBodyEnd:d4880724-031d-43e7-b9bd-ef5b5b1b6c16] --&gt;</description>
      <pubDate>Tue, 23 Aug 2011 13:21:32 GMT</pubDate>
      <author>forums_noreply@adobe.com</author>
      <guid>https://forums.adobe.com/thread/894378</guid>
      <dc:date>2011-08-23T13:21:32Z</dc:date>
      <clearspace:dateToText>3 years 3 months ago</clearspace:dateToText>
      <clearspace:replyCount>17</clearspace:replyCount>
      <clearspace:objectType>0</clearspace:objectType>
    </item>
  </channel>
</rss>

