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
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.
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
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');
}