Actionscript image download open custom viewer
        Posted  
        
            by Vish
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Vish
        
        
        
        Published on 2010-05-26T09:58:50Z
        Indexed on 
            2010/05/26
            10:01 UTC
        
        
        Read the original article
        Hit count: 438
        
Hi Gurus, i am downloading tiff images from WAMP server using our Flex AIR client. Using the following code for that.
public static function requestDownload(id:int, defaultName:String):void {
            //POST params
            var urlVars:URLVariables = new URLVariables();
            urlVars.action = "download";
            urlVars.fid = id;
            var urlReq:URLRequest = new URLRequest();
            urlReq.url = Config.getServerURL();
            urlReq.data = urlVars;
            Config.fileReference.addEventListener(Event.,FileDownload.requestDownloadResultV);
            try {                   
            Config.fileReference.download(urlReq, defaultName);                                 
            }
            catch (e:Error) {                   
                Alert.show("Error in downloading the file");
            }
        }
        public static function requestDownloadResultV(e:Event):void {   
            Alert.show("File downloaded");
        }
No issues with the download. It automatically prompts for a Save dialog. Works well. But i want to open the image being downloaded in a viewer(flash viewer or any) instead of the save dialog.
Please help me. Thanks Vish.
© Stack Overflow or respective owner