tags:

views:

1522

answers:

3

Hi,

When using FileReference.download() to retrieve a file from a server, I'd like to give the user the option to open the associated application directly rather than having to save it to disk first.

Is this possible in Flex 3? And, if so, how is it done!

Thanks, Mark

ps. I've tried doing URLLoader.load(URLRequest) also, but no dice...

+1  A: 

Nope, you can't do that unfortunately. My guess is that this is due to security restrictions.

Christophe Herreman
Thanks Cristophe, I actually came up with a solution that does what I need - simply using navigateToURL(urlReq, "_self").
Mark Nuttall-Smith
+1  A: 

From a web application this is most certainly not possible. It might be possible from an AIR application by asking the operating system to handle the opening of the file and leave it at that. Windows and OS X should be able to handle it gracefully.

Why Adobe restricts such actions from web applications makes sense. It would be a glaring oppurtunity for anyone to create a regular site with a flash app that downloads and runs a virus without the user actually knowing anything about it.

macke
A: 

navigateToURL(urlReq, "_blank") works in most cases, but do not open Excel, CSV files(MS office apps) in IE 7 and older versions.