header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
gourav
Points:540
Posts:0
Answered

6/3/2010 11:54:55 PM

Title: how to download file in AIR flex (local file not URL)


hi..all

can any one tell how to download file from my project to desktop or any drive for example(download from assets/pdf/firstnotes.pdf to d:/mynotes )

im working in flex it can download file form server or any url like
fileObj.download(urlRequest1);
but urlRequest1 should be a type url and i want from like "assets/pdf/firstnotes.pdf " path.


any one have solution then plz reply me soon

thanks in advance



1
Dave
Points: 970
Posts:1
Accepted Answer
6/4/2010 6:37:42 AM



you have to use HTTP or HTTPS , there is no other solution to this. Flash player only permits these protocols while downloading. Its a security restriction.

2
gourav
Points: 540
Posts:0
6/4/2010 6:58:20 AM



ok i got this but cant we change the way i mean can we use any other way like:

copy past or
read and write streem or
any other solution..

plz give me the sample code for this if any one have the solution.

Thanks
Gourav

3
HMS
Points: 280
Posts:0
6/4/2010 7:31:05 AM



you can use navigatetourl which can call the file to open, If the file is not browser supported file it will show you save dialogue

protected function downlodBtn_clickHandler(event:MouseEvent):void
{
	flash.net.navigateToURL(new URLRequest('abc.exe'), '_self');
}



Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 4+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions