Use FileReference and target FP10
El 15/06/2009, a las 8:42, CarLuva <email@example.com> escribió:
Forgive me if this question has an obvious answer; so far I've come
up with nothing.
Here's my scenario: A user has data in a form in my Flex app and
wishes to export the data to a particular file type (let's use KML
as an example) and let the browser handle the resulting file in
whatever manner it typically does so (open in Google Earth, for
instance). The current flow is:
User enters data;
User clicks "Export to KML" button;
Flex validates the data and converts it to valid KML;
Flex executes an HTTP POST to a JSP;
The JSP echoes the data in the POST as the response data with the
content-type for KML data.
This works fine, but I think I should be able to eliminate the JSP
step. However, I cannot find any way for Flex to directly handle
setting up the HTTP response.
- There's no way to do this targeting FP9?
- Can you explain how FileReference would accomplish this? There is no file on the server that's being loaded, it's just dynamically generated content. According to the documentation for FileReference, "The classes do not allow you to read from or write to the transferred file," so I'm not sure how I could use dynamically generated content instead of a static file with this class.
Thanks for your time,