Posted At : July 16, 2007 4:08 PM
42 Comments
If the file reference object is created as a function local variable the download save box appears but the file is never saved.
The solution is documented on the Adobe knowledgbase: FileReference.download() in SWF file fails and I found it via this thread.
The long and short of it is:
Problem code (note the fileRef is inside the function):
Hope it saves someone some time - or increases the chances of the technote being found quickly via google.
Cheers, Mark
42 Comments
Hmm good stuff dude. thanks for your info.
Wish this had been posted 2 weeks ago :-(
I had the same problem and ended up implementing the full example provided in the Flex 3 docs. The weird thing was it seemed to work and the stopped functioning a week later, but it could have been my imagination. At least now I know it wasn't me - exactly :-)
Richard
wow that little info helped me out big time! LOL for a second there I thought I would have to put my files on a direct link.
you have just saved my life :)
That saved me a lot of time and pain!!
Thanks to you and Google. Life is easier.:)
I HIT THIS and wasted like 3 hours! thank you!!! STEF
Mark, you are my hero!!!
Thanks! Only wish I'd found your post sooner.
Thanks! Right info @ the right time.
I've been working on this problem in my code since yesterday :(
Very useful link, thank you!
thanks i was having the same problem, thanks a lot
gracias amigo
Many thanks for this. It was tough for person like me to figureout where and what went wrong. You saved my time.
Wow, amazing to see this is roadblock for a lot of people, me included. I hit this issue but luckily I moved on to other parts but probably wasted about two hours trying to figure out why it wasn't working. So glad you're on page 1 of google with this :-D
THANK YOU SO MUCH FOR THIS POST !
You rock! You just saved me many hours of debugging.
1st time I find a bug solution in a few seconds... relevant topic ! merci bien ;)
thanks--exactly the help I needed!
Thanks a lot, I have the same problem and last 3 hours breaking my head. Very Helpful...
OMG! I will never catch theproblem....
Thx :)
Thank you so much, you saved my life. :o)
thanks for making this easy to find. next time i'll go to google sooner.
oh my god!!!
i'm ready to cry. I thought I must be incredibly dumb. Thank you! Thank you! Thank you!
Heh! this little gem is still working hard! Just spent a couple hours trying to understand why my upload code works but my download blew chunks!
Refactoring broke my stuff!!
Many Thanks!
Thanks so much! was scratching my head for a few days on this =]
Thanks Dude! Best info ever.
i woke up 3 o'clock this morning after 5 hours of sleep just to think about why my download doesn't work. this made my day.
Kiitos
Really Thanks!!! You've just saved some days of my time.
Thank you.
Like all previous comment...!!! Thanks a lot...
Wow! Thanks!
Hi ALL I you have a problem to download some files using FileReference.Download()
please check this example under the below link:
http://www.acoukess.info/bernard/download-in-AS3.z...
Hi ALL I you have a problem to download some files using FileReference.Download()
please check this example under the below link:
http://www.acoukess.info/bernard/download-in-AS3.z...
Thanks a lot. It's saves me quite much time. GREAT JOB !!!
Thanks a lot. I had the same problem. The example in the documentation is incorrect. I would have eventually found it, but this saved me a lot of time
Yea.I was spending about an hour.
However it is totally wierd, because server is returning
206 Partial Content
Brr. Thanx, anyway.
var fileRef:FileReference = new FileReference();
function downloadFile():void {
fileRef.download(new URLRequest("myFile.txt"), "myFile.txt");
}
Solved partially.
If in windows "Hide known file extensions" is checked.
the save as popup wiill come with filename as "myFile".
if I download it it will work fine and file be with ".txt" extension automatically.
But
If I rename "myFile" to "myFile11" it will be downloaded
but become unuseable.
Have any workaround for this.
Hi,
I was wondering if its possible to download from an XML list. I tried referencing from xml file's url node, but it seems it won't detect, I kept getting an error saying I can only put http or https address/protocol.
Thanks,
Reina Lyn Ben
Thanks 4 sharing. You saved my time also
Thanks a lot!!! is exacly what I need thank you very much
Thanks a lot . the same happened to me and the file doesnt get saved . You saved me a bunch.
This is a winner. Thanks so much for posting it.
I spent 4 hours trying to call a php scrift from Flash before I abandoned that approach and figured I'd try to do it from Flash and spent another hour trying to get,what seemed so simple in the examples, to work. Finally, I found your brilliant bit of stuff bud. Thanks for that You're my hero.