Downloading a file
Hi Folks,
Can any one explain the following to me:
Used the following code in a real life demo. I clicked the button, SaveAs dialog displayed, I chose to say the file in the Documents folder.
Went to open the file, and got a message saying it was in use with another process. Restarted my computer, was now able to open the file. However the file is empty. It should have some text that I put in there - how can text vanish from a file? By simple downloading it.
info_form.download_file.buttonMode = true;
info_form.download_file.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
function mouseDownHandler(event:MouseEvent):void {
var pdf = new FileReference();
pdf.download(new URLRequest(" http://www.somesite.co.uk/media/myFile.txt"));
}
Am I missing something here?
Any help appreciated.
Kind Regards,
Boxing Boom