Why doesn't AS3 FileReference Download Work in IE/FF (Works fine in Chrome)

I am generating an Excel file with Java on the back-end and it seems to work just fine in Chrome but for whatever reason it doesn't in FF/IE. I have the very latest of Flash in each browser listed from this site: http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html
I'm sending XML to the server, it is generating the Excel and sending it to the Flash. I'm performing the export by doing the following:
private var _fileRef:FileReference;
private function exportReport(e:MouseEvent):void
    _fileRef = new FileReference();
    _fileRef.addEventListener(Event.COMPLETE, excelExportCompleteHandler);
    _fileRef.download(new URLRequest("exportReport"), "report.xlsx");
    function excelExportCompleteHandler(e:Event):void {
        trace('complete');
There are no error messages from Java/Flash. The browse popup comes up and I save the file the same in IE/FF as I do in Chrome. the trace('complete') is executed every time in every browser but the file only shows up when using Chrome.
I also searched my filesystem and found temporary internet file shortcuts with the name of the file I was trying to download so it's as if it started the download but didn't finish it for some reason. The location of those files is AppData\Roaming\Microsoft\Windows\Recent Items

Definitely not a timeout, it takes < 5 seconds for the web service call to finish
I can also copy and paste the request url with data into the browser and it will successfully download the report just through the browser which made me realize I could use javascript as a non-ideal workaround solution to this problem.
I would still love to know why it was failing and if anyone has any ideas that would be great but for anyone else with the same issue as me here is the workaround I used:
as3 code (I used URLVariables to encode the data because trying encodeURI or encodeURIComponent didn't encode ' or " which would cause errors when doing the ExternalInterface.call()
var reportData:String = getReportXML().toString();
var variables:URLVariables = new URLVariables();
variables.q = reportData;
//Substring at 2 to trim off the 'q=' portion
reportData = variables.toString().substring(2);
ExternalInterface.call("function() { return downloadExcelReport('"+reportData+"')}");
javascript code (I used a hidden form because I needed to be able to perform a POST because the xml data I was passing was too large for a GET)
<script type="text/javascript">
    function downloadExcelReport(reportData) {
        reportData = decodeURIComponent(reportData);
        window.open("about:blank", "newWindow");
        document.getElementById("reportData").value = reportData;
        document.getElementById("reportForm").submit();
</script>
<form id="reportForm" method="post" target="newWindow" action="<%=SERVER_PATH%>excelReport">
    <input type="hidden" name="solutionReportXml" id="reportData" value="">
</form>

Similar Messages

  • Why doesn't the update part of the App Store work?

    Why doesn't the update part of the App Store work? It says I have an update and the screen is white. I've already restarted the phone. Every other part of the App Store works. I have the iPhone 4. Upgraded a week ago to iOS6 and it was working fine up until yesterday. Not sure what to do? Help!

    Why doesn't the update part of the App Store work? It says I have an update and the screen is white. I've already restarted the phone. Every other part of the App Store works. I have the iPhone 4. Upgraded a week ago to iOS6 and it was working fine up until yesterday. Not sure what to do? Help!

  • Why doesn't my email download unless I open app?

    Why doesn't my email download unless I open app?

    Yes, the settings are correctly set on the iphone 4s.  It is a Yahoo email address.  I am not using iCloud.  Do you HAVE to have an icloud email account first in order for it to push automatically to other email accounts?

  • Why doesn't my computer download the songs from my iphone with clouds next to them?

    Why doesn't my computer download the songs from my iphone with clouds next to them?

    You can copy iTunes purchased songs over to your computer's iTunes library via File > Devices > Transfer Purchases, or have you tried going to the Purchased link under Quick Links on the right-hand side of the iTunes store homepage on your computer's iTunes and seeing if you can redownload them on your computer ?

  • Why doesn't Apple mail download Gmail messages that were sent to myself?

    When I e-mail myself to my Gmail address, the message sits in the Gmail inbox but Apple
    Mail doesn't download it.
    Mail downloads every other message in the Gmail inbox, but not the ones i've addressed to myself to my Gmail address.
    Any ideas for why this is happening?

    Gmail POP access doesn’t work like a normal POP mail server would. Here are some of its idiosyncrasies:
    1. Messages downloaded by any conventional POP mail client are marked as downloaded at the server (but not as read on the web), and no longer available to either the same or any other POP mail client.
    2. To make already downloaded messages available for POP access again, you must go to Gmail’s Settings > Forwarding and POP page, select Enable POP for all mail, and click Save Changes, which causes everything (and I mean everything) still on the server to be downloaded again.
    3. The Mail > Preferences > Accounts > Advanced > Remove copy from server settings have absolutely no effect on the messages stored on Gmail’s server. Gmail ignores any requests to delete messages from the server made by a POP client. What happens to the messages on the server after a POP client has downloaded them is determined by Gmail’s Settings > Forwarding and POP > When messages are accessed with POP setting alone. In the case of Gmail (and only in that case), I recommend turning OFF Remove copy from server in Mail, so that Mail doesn’t even try to remove any messages from the server, regardless of whether you do actually want already downloaded messages to be removed from the server after some time or not.
    4. Messages sent using the web interface will be downloaded by your POP mail client as if they were received messages. Although this may seem weird, it's good because it allows archiving all messages locally in Mail, regardless of how they were sent — as long as you don't access the same Gmail account with more than one POP mail client, that is. You can set up a rule in Mail to automatically route those messages to the appropriate Sent mailbox (or to any other mailbox for that matter) if that's what you want.
    5. Messages sent using a POP/SMTP mail client such as Mail are also treated as if they were incoming messages for POP purposes, just as in #4. What prevents them from being downloaded is that Gmail marks them as already downloaded immediately. Since they’re on the server nonetheless, already sent messages would be downloaded together with all the other messages on the server if proceeding as described in #2.
    6. A particular case of #5 are messages sent to yourself. Instead of putting a copy of the sent message in the server’s Inbox and making it available for download, both the sent and the “received” message on the server are actually one and the same, and hence, cannot be downloaded via POP for the reason explained in #5.
    7. Gmail allows POP accounts to be set up in a special way that avoids some of these issues while introducing others. If you only need POP access to the last 30 days of mail, you may configure Mail in “recent mode”, as described in Using POP on multiple clients or mobile devices. Configuring the account this way would allow Mail to download messages marked by Gmail as already downloaded (and download messages sent to yourself in particular), but it would also cause all sent messages (not just messages sent to yourself or through webmail) to be downloaded as if they were received messages.

  • Why doesn't CS 6 download files from camera or reader.

    I have updated CS6 raw converter to 8.2.0 but the message I get says CS6 cannot download the files either form the 7D camera or the card reader. It will download jpg. What do I need to do to correct this?

    Gidday Sheila
    My brother was having this problem with Adobe Bridge CS6 for the last two days (and using PhotoDownloader.exe directly). Why Adobe and everyone else cannot manage to use the correct terminology for this is beyond me - moving data from a device that's further down the food chain to a device further up the food chain, i.e. from a card reader to a computer, is Uploading, not Downloading ... ).
    After many trials and tribulations (he is interstate ... ), I discovered that he was uploading using the folder date method, and he already had a folder for the date in question, and a file in that folder was probably corrupt. Probably one of the Bridge data files, if the truth be known.
    I got him to rename that folder, and voilà, both PhotoDownLoader,exe and Bridge (which calls Photodownloader.exe ... ) suddenly worked perfectly.
    It appears to me that the programmer coding the error messages/error trapping was either too lazy or too ignorant to correctly code the error as an Adobe or Bridge database error, instead blaming the poor innocent card reader, of which my brother has three, all of which work perfectly ... The HDD involved had a boot-time CHKDSK run on it only about a week ago to verify its health regarding another, completely unrelated issue.
    What it boils down to is that this problem has existed since around CS2 or even PS v.7.x (and PSE, etc), without Adobe bothering to even use their heads to logically work out what was actually causing the problem. It is nothing whatsoever to do with the card reader; ACR version; etc. It's just plain lousy programming and error trapping ...
    I hope this helps you and others to understand how this problem is caused by poor programming, nothing to do with the card reader.

  • Why doesn't saving a print preset for selection printing work anymore? It previously did up to version 2.

    I regularly like to highlight areas on web-pages, select print/name a print preset as "Print Selection" and check-mark 'Print Selection Only' of Options under the Firefox sub-heading. Then when I wanted to quickly print a selection instead of a whole web-page, I just highlighted an area, activated print, selected "Print Selection" and then checked print preview to view the selection before printing. That worked from version 2 only.
    Now in version 3 +, all above can be done '''except''' the check-marked 'Print Selection Only' option in the Firefox sub-heading keeps resetting itself, even IF you have saved it check-marked as a print preset. Selecting the saved preset "Print Selection" next time will print (preview) the whole web-page, and not what was highlighted (selected) for printing. Why was this feature turned off?

    baileyb1 wrote:
    My skype used to work, and now it doesnt work anymore. I just get an error message now.
    Access violation at address "Skype.exe" Read of address 0000000048.
    Help, it used to work before but no longer. I dont know how to get it working again.
    Baileyb1
    Open Windows Event Viewer -> Custom Views -> Administrative Events. Look for the recent error messages with timestamp corresponding to Skype crash. Copy and paste here the text from the General tab.

  • HT5012 Why doesn't my charging case for my iPhone 5 work since updat7.0.4

    Why won't my charging case work since update7.0.4

    What brand of charging case are you referring to? Check the manufacturer's web site for answers?

  • Why doesn't my custom download manager get launched by Safari?

    Hi all,
    I'm working on a download manager for Leopard, Snow Leopard and possibly Tiger. It's a single window app that should get launched when the browser downloads a file with a custom extension, similar to the way the Amazon MP3 Downloader works with *.amz files.
    My test app is set up to handle ".mytype" files and gets launched as expected when you double-click a ".mytype" file in the Finder or download one with Firefox.
    Unfortunately, Safari just downloads the file and never launches my app. I can double-click on the file in Safari's Downloads window and it launches my app, but I need it to launch automatically.
    Any hints or advice would be greatly appreciated.
    Thanks,
    Tom
    Code below built with Xcode 3.1.2, target 10.5|Release|i386
    Document type section of Info.plist:
    <key>CFBundleDocumentTypes</key>
    <array>
    <dict>
    <key>CFBundleTypeExtensions</key>
    <array>
    <string>mytype</string>
    </array>
    <key>CFBundleTypeIconFile</key>
    <string>Icon</string>
    <key>CFBundleTypeMIMETypes</key>
    <array>
    <string>application/x-mytype</string>
    </array>
    <key>CFBundleTypeName</key>
    <string>mytype Doc</string>
    <key>CFBundleTypeRole</key>
    <string>Editor</string>
    </dict>
    </array>
    Application delegate functions:
    // this one gets called when downloading in FF, no luck in Safari
    - (void)application:(NSApplication *)sender openFiles:(NSArray *)filenames
    NSLog(@"in application:openFiles");
    [sender replyToOpenOrPrint: NSApplicationDelegateReplySuccess];
    // this one works in FF if I remove application:openFiles above
    // I tried both methods in case it made a difference
    - (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
    NSLog(@"in application:openFile: %@", filename);
    return YES;
    testfile.mytype (served as PHP by apache):
    <?
    header('Content-Disposition: filename="testfile.mytype"');
    header("Content-Type: application/x-mytype");
    $body = "
    sample file contents
    header("Content-Length: " . strlen($body));
    echo $body;
    ?>

    Ray,
    Thanks for the folder monitoring idea. I'd still like to get the original problem solved, but that might be an acceptable workaround.
    The download manager is for a commercial product. All the examples of folder actions that I found involved the user selecting the folder and the script that gets executed. Is this process scriptable by my install program, even if the user has folder actions disabled?
    Another option might be using the WatchPaths option in LaunchAgents and have it launch my program when a new ".mytype" file is detected.
    I'm pretty new to Mac programming (unix background) - what would be the pros and cons of LaunchAgents vs. Folder Actions?
    Also, I know that "~/Downloads" is the standard location to save downloaded files, but what if the user changes it to a different folder in Safari Preferences?
    Regarding the original problem...
    "Open safe files after downloading" is checked in my Safari preferences.
    Since I will be distributing the program I don't want to go mucking about with overriding the built-in list of safe file types.
    Would it make sense to write a Safari plugin to handle the custom file types? The sample plugins that I looked at all deal with the custom types in the context of the browser page (like a movie viewer), but I want to launch an external application to handle the file. Is that possible? Or is watching the Downloads folder for new files a better approach?
    Thanks,
    Tom

  • Why doesn't my "Airport Express 802.11n wi-fi" work?

    I have bought an "Airport Express 802.11n wi-fi" last year. It was working up to last week, but it doesn't work now. I have reset to factory setting but my Airport utility was unable to find my airport wireless.

    Try temporarily connecting your computer directly to the AirPort Express using an Ethernet cable. Then try accessing it with the AirPort Utility.

  • Why Doesn't Making iTunes Your Default Media Player Always Work?

    I bought a new hard drive on my desktop PC and I installed Windows 7 Pro on it.  I just installed iTunes version 10.6.1.7.  Everything that's in my itunes music folder seems to be playing fine.
    When I inserted an mp3 audio file (from Dropbox)into my iTunes folder and double-clicked to play it, Windows Media Player opened and played it.  So I opened the Auto Play window in Windows Control Panel to make iTunes my default audio player.
    I was able to set iTunes as my default player when I insert an audio CD into my PC.  iTues also plays songs that I download from the internet.  But when I attempted to select iTunes as my default player for audio files that I copied and pasted into the iTunes folder, it wasn't listed on the pulldown menu. The only choices listed on the pulldown menu are:
    Windows Media Player
    Input Pictures & Video Using Dropbox
    Open folder to view files using Windows Explorer
    Take No Action and
    Ask Me Every Time
    How can I make iTunes my default media player for any audio file that I wish to play?

    Right click mp3 file and select "Open with", then "Choose Default Program....."

  • Why doesn't the home button on my iphone 4 work all the time?

    Often, despite pressing repeatedly, it just won't take me out of the programme I'm currently in.

    How old is your phone?  It is my understanding that they do wear out; some sooner, some later.

  • Why doesn't the iPad allow downloads of attachments?

    Why doesn't my iPad download attachments? The message is" safari can't load this".

    I view many attachments on both my iphone and ipad on a daily basis.
    What kind of file is it?

  • Why doesn't the new flash player I downloaded work on my mac?

    Hi,
    I download the last new flash player on my mac under Lion and I can't open some website like adobe websites

    Hi Sunil,
    I try http://www.adobe.com/software/flash/about/ and the file attach is the result: a white page.
    I uninstall it yesterday and download the last version on adobe
    it's on firefox, I can use safari but I need to reload many time to have something
    Le 27 sept. 2011 à 13:09, Sunil_Bhaskaran a écrit :
    Re: Why doesn't the new flash player I downloaded work on my mac?
    created by Sunil_Bhaskaran in Flash Player - View the full discussion
    After downloading, you need to run the installer.
    Could you please visit this site: http://www.adobe.com/software/flash/about/
    If Flash Player is installed in your machine, it will give you the version number.
    In the following link, you have step-by-step instructions on installing Flash Player on Mac:
    http://kb2.adobe.com/cps/908/cpsid_90893.html
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/3940045#3940045
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/3940045#3940045. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Flash Player by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Adobe, Why doesn't the download link for FreeHand work???!!!!!!

    Adobe, Why doesn't the download link for FreeHand work???!!!!!!

    Right! I tried the trial download links and nothing happens: http://www.adobe.com/cfusion/tdrc/index.cfm?loc=en&product=freehand
    The download links are working for other discontinued programs like Pagemaker and GoLive but I see that this page officially made FreeHand no longer for purchase.
    Discontinued products

Maybe you are looking for