tags:

views:

1510

answers:

2

I checked in the API, that writing a file is only in Flex Air. Despite of that, is there still a way in Flex to write a file on the server or on the client machine ?

More concretely, it's because I have a String and I will decode it by mx.utils.Base64Decoder to a doc. And I need to open it by Word directly on the client side, or write it on the server and return the link to the client for downloading.

Thanks

A: 

AIR applications run on the users' desktops. They allow you to write to the users' desktops. Nothing stops Flex/AIR applications from communicating to the server, write some files there (using a suitable backend technology) and return a link back to the user.

dirkgently
I meant not using air, only Flex web application. Or if it's possible to run an Air application by the Flex. Thanks for replying
maoanz
@maoanz: As I said, it really shouldn't be difficult since even Flex allows you to upload files. Do you need any specific API references?
dirkgently
+1  A: 

I'm doing something similar - I have built a custom grid in Flex that contains an additional button on it that allows the user to open the data up in Excel. I've done this by writing a function in PHP on the server which my Flex speaks to. This creates the CSV file on the server and the function passes the link back to the client, which in turn offers the user the chance to open the data up in Excel.

I'm using the Zend technologies to accomplish this - I recommend you take a look; they're extremely good. I used to use Flex Data Services and Java do do this but just recently switched to PHP because development time is cut down drastically as a result.

Hope this helps.

Jamie.

badmanj