<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Downloading files in Flex using the FileReference class</title>
	<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/</link>
	<description>A bunch of examples for Adobe Flex and ActionScript</description>
	<pubDate>Tue, 06 Jan 2009 08:31:51 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Madhav</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-17524</link>
		<author>Madhav</author>
		<pubDate>Thu, 01 Jan 2009 05:39:32 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-17524</guid>
		<description>Hi,

    I want to capture the request, read a file in the backend (java) and send it to the flex. Is it possible to do this way ?? Can u please suggest me with some idea if you come up with any ??

Thanks,
Madhav.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>    I want to capture the request, read a file in the backend (java) and send it to the flex. Is it possible to do this way ?? Can u please suggest me with some idea if you come up with any ??</p>
<p>Thanks,<br />
Madhav.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter deHaan</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-17306</link>
		<author>Peter deHaan</author>
		<pubDate>Wed, 10 Dec 2008 15:47:31 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-17306</guid>
		<description>Dave,

Welcome to Flex!
First, I'd make sure you update your Flex Builder to the latest version (Flex Builder 3.0.2 with Flex SDK 3.2). For instructions, check out &lt;a href="http://blog.flexexamples.com/2008/11/19/upgrading-to-flex-builder-302/" rel="nofollow"&gt;&lt;u&gt;"Upgrading to Flex Builder 3.0.2"&lt;/u&gt;&lt;/a&gt;. This ensures you're using the latest version of Flex Builder and the latest stable version of the Flex SDK (although you are able to download nightly builds of the Flex SDK which may include additional bug fixes). For more information, see &lt;a href="http://blog.flexexamples.com/2008/08/01/downloading-and-installing-flex-sdk-builds-from-opensourceadobecom/" rel="nofollow"&gt;&lt;u&gt;"Downloading and installing Flex SDK builds from opensource.adobe.com"&lt;/u&gt;&lt;/a&gt; and &lt;a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/" rel="nofollow"&gt;&lt;u&gt;"Using the beta Gumbo SDK in Flex Builder 3"&lt;/u&gt;&lt;/a&gt;.

But, back to your question. Check out the FileReference archive on this site at: &lt;a href="http://blog.flexexamples.com/tag/filereference/" rel="nofollow"&gt;&lt;u&gt;http://blog.flexexamples.com/tag/filereference/&lt;/u&gt;&lt;/a&gt;. Or more specifically, check out the following article: &lt;a href="http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-uploading-it-using-the-filereference-class-in-flash-player-10/" rel="nofollow"&gt;&lt;u&gt;"Previewing an image before uploading it using the FileReference class in Flash Player 10"&lt;/u&gt;&lt;/a&gt;. I'm not sure if the latest version of Flash Player 9 has similar capabilities, but the previous solution was that after the user selected a file from their OS, you would need to upload the file to a server-side script and then download the file back to the client using FileReference again, and then you could parse the XML document and display it in a DataGrid or whatever. Personally, I think the easiest solution would be to use Flash Player 10 and following the &lt;a href="http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-uploading-it-using-the-filereference-class-in-flash-player-10/" rel="nofollow"&gt;&lt;u&gt;"Previewing an image before uploading it using the FileReference class in Flash Player 10"&lt;/u&gt;&lt;/a&gt; entry. Next, in the &lt;code&gt;fileReference_complete()&lt;/code&gt; method I'd convert the &lt;code&gt;fileReference.data&lt;/code&gt; property to an XML object and then set the DataGrid control's data provider to an XMLList or XMLListCollection object. You may need to use some label functions to display the XML data correctly, but it should be fairly easy. The trickier part is that the user could select any file or the wrong type of XML document structure, so you may need to add some clever validation to ensure the XML data is what you expect.

Happy Flexing!
Peter</description>
		<content:encoded><![CDATA[<p>Dave,</p>
<p>Welcome to Flex!<br />
First, I&#8217;d make sure you update your Flex Builder to the latest version (Flex Builder 3.0.2 with Flex SDK 3.2). For instructions, check out <a href="http://blog.flexexamples.com/2008/11/19/upgrading-to-flex-builder-302/" rel="nofollow"><u>&#8220;Upgrading to Flex Builder 3.0.2&#8243;</u></a>. This ensures you&#8217;re using the latest version of Flex Builder and the latest stable version of the Flex SDK (although you are able to download nightly builds of the Flex SDK which may include additional bug fixes). For more information, see <a href="http://blog.flexexamples.com/2008/08/01/downloading-and-installing-flex-sdk-builds-from-opensourceadobecom/" rel="nofollow"><u>&#8220;Downloading and installing Flex SDK builds from opensource.adobe.com&#8221;</u></a> and <a href="http://blog.flexexamples.com/2008/08/02/using-the-beta-gumbo-sdk-in-flex-builder-3/" rel="nofollow"><u>&#8220;Using the beta Gumbo SDK in Flex Builder 3&#8243;</u></a>.</p>
<p>But, back to your question. Check out the FileReference archive on this site at: <a href="http://blog.flexexamples.com/tag/filereference/" rel="nofollow"><u><a href="http://blog.flexexamples.com/tag/filereference/" rel="nofollow">http://blog.flexexamples.com/tag/filereference/</a></u></a>. Or more specifically, check out the following article: <a href="http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-uploading-it-using-the-filereference-class-in-flash-player-10/" rel="nofollow"><u>&#8220;Previewing an image before uploading it using the FileReference class in Flash Player 10&#8243;</u></a>. I&#8217;m not sure if the latest version of Flash Player 9 has similar capabilities, but the previous solution was that after the user selected a file from their OS, you would need to upload the file to a server-side script and then download the file back to the client using FileReference again, and then you could parse the XML document and display it in a DataGrid or whatever. Personally, I think the easiest solution would be to use Flash Player 10 and following the <a href="http://blog.flexexamples.com/2008/08/25/previewing-an-image-before-uploading-it-using-the-filereference-class-in-flash-player-10/" rel="nofollow"><u>&#8220;Previewing an image before uploading it using the FileReference class in Flash Player 10&#8243;</u></a> entry. Next, in the <code>fileReference_complete()</code> method I&#8217;d convert the <code>fileReference.data</code> property to an XML object and then set the DataGrid control&#8217;s data provider to an XMLList or XMLListCollection object. You may need to use some label functions to display the XML data correctly, but it should be fairly easy. The trickier part is that the user could select any file or the wrong type of XML document structure, so you may need to add some clever validation to ensure the XML data is what you expect.</p>
<p>Happy Flexing!<br />
Peter</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-17301</link>
		<author>Dave</author>
		<pubDate>Wed, 10 Dec 2008 09:46:54 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-17301</guid>
		<description>Hi! i'm beginning to move first step  to Flex 3.0
I need to find a sample to teach me how can i use FileReference Class for understand how i can do  this:
I need to open, with a button, a O.S. browse folder windowa to choose a xml file to show him into a datagrid... i have write the code for datagrid, controls and so onbut, but i don't know how pass the file name selected to datagrid to show the nodes... 
can you help  me please?
Thanks a lot
PS i read many of your sample very usefully and well explaned
Bye 
Dave Zegna</description>
		<content:encoded><![CDATA[<p>Hi! i&#8217;m beginning to move first step  to Flex 3.0<br />
I need to find a sample to teach me how can i use FileReference Class for understand how i can do  this:<br />
I need to open, with a button, a O.S. browse folder windowa to choose a xml file to show him into a datagrid&#8230; i have write the code for datagrid, controls and so onbut, but i don&#8217;t know how pass the file name selected to datagrid to show the nodes&#8230;<br />
can you help  me please?<br />
Thanks a lot<br />
PS i read many of your sample very usefully and well explaned<br />
Bye<br />
Dave Zegna</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shobhit</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16788</link>
		<author>Shobhit</author>
		<pubDate>Wed, 19 Nov 2008 12:08:44 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16788</guid>
		<description>Hello,
Thanks for ur greate example, i m facing a problem while downloading, once i downloaded the file and after it when i changes the content of file .. it is not reflected in new downloaded file,
i need to restart the server ,
please help.</description>
		<content:encoded><![CDATA[<p>Hello,<br />
Thanks for ur greate example, i m facing a problem while downloading, once i downloaded the file and after it when i changes the content of file .. it is not reflected in new downloaded file,<br />
i need to restart the server ,<br />
please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saji</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16742</link>
		<author>Saji</author>
		<pubDate>Mon, 17 Nov 2008 05:12:47 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16742</guid>
		<description>Hi Thanks for this great example. I used it in one of my applications for creating a flex downloader. This downloader fetches a list of files to be downloaded from the server. Once the list is retrived, on clicking the file names in the list it will open a save dialog box and start downloading the file. 
My concern is that, I need to create a downloader where in the destination folder is selected by the user for saving the files and then one by one the files are to be downloaded to that folder. Can any one show me some way to do it in Flex?

Thanks for any help
saji</description>
		<content:encoded><![CDATA[<p>Hi Thanks for this great example. I used it in one of my applications for creating a flex downloader. This downloader fetches a list of files to be downloaded from the server. Once the list is retrived, on clicking the file names in the list it will open a save dialog box and start downloading the file.<br />
My concern is that, I need to create a downloader where in the destination folder is selected by the user for saving the files and then one by one the files are to be downloaded to that folder. Can any one show me some way to do it in Flex?</p>
<p>Thanks for any help<br />
saji</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adobe Flex Tutorial</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16732</link>
		<author>Adobe Flex Tutorial</author>
		<pubDate>Sun, 16 Nov 2008 18:24:19 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16732</guid>
		<description>@Eric
i ran into the same problem, the download dialog window lets me choose a file but then i get an IOError. Actually, the problem is that i defined my FileReference Object in the same function that i call the download() method. A quick workaround is to declare a dummy function or define your FileReference object outside the function.

For more information:
(in French)
http://www.flex-tutorial.fr/2008/11/16/flex-filereference-ioerror-lors-de-lappel-a-download-resolu/
(in English)
http://blog.computerelibol.com/?p=17

Fabien</description>
		<content:encoded><![CDATA[<p>@Eric<br />
i ran into the same problem, the download dialog window lets me choose a file but then i get an IOError. Actually, the problem is that i defined my FileReference Object in the same function that i call the download() method. A quick workaround is to declare a dummy function or define your FileReference object outside the function.</p>
<p>For more information:<br />
(in French)<br />
<a href="http://www.flex-tutorial.fr/2008/11/16/flex-filereference-ioerror-lors-de-lappel-a-download-resolu/" rel="nofollow">http://www.flex-tutorial.fr/2008/11/16/flex-filereference-ioerror-lors-de-lappel-a-download-resolu/</a><br />
(in English)<br />
<a href="http://blog.computerelibol.com/?p=17" rel="nofollow">http://blog.computerelibol.com/?p=17</a></p>
<p>Fabien</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16216</link>
		<author>Eric</author>
		<pubDate>Fri, 17 Oct 2008 03:26:03 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16216</guid>
		<description>Hello i am working on adding a Flex frontend to some of my existing stuff. I have a CSV export that is generated at runtime by 

http://domain.com/csv_export.php?mode=all

It uses php header() to export a file in a browser. In IE my Flex says downloading but nothing happens. If I try in Firefox I get 

Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.

Has anyone seen this??

Thx,
Eric</description>
		<content:encoded><![CDATA[<p>Hello i am working on adding a Flex frontend to some of my existing stuff. I have a CSV export that is generated at runtime by </p>
<p><a href="http://domain.com/csv_export.php?mode=all" rel="nofollow">http://domain.com/csv_export.php?mode=all</a></p>
<p>It uses php header() to export a file in a browser. In IE my Flex says downloading but nothing happens. If I try in Firefox I get </p>
<p>Error #2044: Unhandled IOErrorEvent:. text=Error #2038: File I/O Error.</p>
<p>Has anyone seen this??</p>
<p>Thx,<br />
Eric</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gino8080</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16117</link>
		<author>gino8080</author>
		<pubDate>Fri, 10 Oct 2008 12:16:50 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16117</guid>
		<description>Hello and many thank for this grewat example!!

i have just one problem, the same of sandrokan

the file extension is Lost if you change the name :(

any way to solve this problem?

any help is very welcome :)
thank you very much!</description>
		<content:encoded><![CDATA[<p>Hello and many thank for this grewat example!!</p>
<p>i have just one problem, the same of sandrokan</p>
<p>the file extension is Lost if you change the name :(</p>
<p>any way to solve this problem?</p>
<p>any help is very welcome :)<br />
thank you very much!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DSXP</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16067</link>
		<author>DSXP</author>
		<pubDate>Tue, 07 Oct 2008 19:04:55 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-16067</guid>
		<description>Hi there!

I was playing with this and PHP and found that if you try to download a file with zero-bytes length you will get an IOError... like the upload example [http://blog.flexexamples.com/2007/09/21/uploading-files-in-flex-using-the-filereference-class/]

DSXP</description>
		<content:encoded><![CDATA[<p>Hi there!</p>
<p>I was playing with this and PHP and found that if you try to download a file with zero-bytes length you will get an IOError&#8230; like the upload example [http://blog.flexexamples.com/2007/09/21/uploading-files-in-flex-using-the-filereference-class/]</p>
<p>DSXP</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peterd</title>
		<link>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-15859</link>
		<author>peterd</author>
		<pubDate>Fri, 26 Sep 2008 07:19:39 +0000</pubDate>
		<guid>http://blog.flexexamples.com/2007/07/28/downloading-files-in-flex-using-the-filereference-class/#comment-15859</guid>
		<description>bhargavi,

I'm not 100% certain, but I don't think it is possible to automatically open a file on a user's computer after the user has downloaded it.

Peter</description>
		<content:encoded><![CDATA[<p>bhargavi,</p>
<p>I&#8217;m not 100% certain, but I don&#8217;t think it is possible to automatically open a file on a user&#8217;s computer after the user has downloaded it.</p>
<p>Peter</p>
]]></content:encoded>
	</item>
</channel>
</rss>
