Firstly, you cannot use File Functions in Flex. You can do that only in Air. Better use a Coldfusion script to save it in your Desktop.
Mark this if helpful
ColdFusion is a server based language. It will have even less access tothe user's desktop than the Flash Player. No CF Script will allow him to save a file to the user's desktop.
But, you do have limited access to the user's system in Flex. You should look at the FileRefernece class. The docs say it can be used for uploading and downloading files.
I suspect the best you can do is open up a "system prompt" allowing the user to save the file at a location of their choice. If you're using an AIR app, take a look at the File object which gives slightly greate flexibility for dealing with local files:
For flex side u can go for the file class or filereference class and download the file from coldfusion server and save it in ur local machine through flex filereference class.. that will open the file as it is with that extension ie txt or pdf or any thing.
go throuh the file reference class in flex3 or 4 doc help in adobe .. that will help u clearly
i got how to download file.but i got error Save button in SAVE AS Dialog .when i click save button
Error #2044: Unhandled SecurityErrorEvent:. text=Error #2048: Security sandbox violation: http://istdocstor-1722772105/Flex_TestIST/TestFile.swf cannot load data from \\test-sql-01\DD\F8M\Root/New Text Document_20100323003136805.txt.
In SAVE AS DIALOG BOX .file type shows Allfiles(*.*).now i want what type file only show there.