Hello, am trying to download a document using flex by calling it from a dynamic 
source but its not working. here is a sample of the download code i have. Maybe 
is the Url string am getting wrong. The documents are stored in the documents 
folder.

private var fileRef:FileReference;
            private var progress_win:progress_popup;
            
            private function openHandler(event:Event):void
            {
                progress_win.uploadProgress.label="downloading %3%% of image 
file.";
            }

            private function progressHandler(event:ProgressEvent):void
            {
                progress_win.uploadProgress.setProgress(event.bytesLoaded, 
event.bytesTotal);
            }

            private function fileRef_complete(event:Event):void
            {
                //message.text+=" (complete)";
                removeMe();
            }

            private function removeMe():void
            {
                PopUpManager.removePopUp(progress_win);
            }

            public function startDownload():void
            {

                var url:String="documents/{docs.selectedItem.documentName}";

                var fileRef:FileReference=new FileReference;
                var urlRequest:URLRequest=new URLRequest(url);
                navigateToURL(urlRequest, "_new");

                fileRef.download(urlRequest);

            }
 

  • [flexcoders] downlaoding... stinas...@yahoo.com [flexcoders]

Reply via email to