0

I have an application where user click on icon and a file get downloaded. The extension of the file is:

txt.htm.xls

I have set the preference:

             profile.setPreference("browser.helperApps.neverAsk.saveToDisk", 
            "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;");

but this is not working as it seems to be incorrect MIME type.

halfer
  • 19,824
  • 17
  • 99
  • 186
Gaurav
  • 85
  • 4
  • Possible duplicate of [Auto-download in firefox browser with java-selenium not working](https://stackoverflow.com/questions/45589571/auto-download-in-firefox-browser-with-java-selenium-not-working) – undetected Selenium Oct 23 '17 at 13:37
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Oct 23 '17 at 18:55
  • I am able to download pdf correctly but this is an issue with format "txt.htm.xls" – Gaurav Oct 24 '17 at 10:51

1 Answers1

0
profile.setPreference("browser.helperApps.neverAsk.saveToDisk", 
        "text/plain,text/html, application/xml");

This should solve your problem

RArora
  • 234
  • 1
  • 7