0

enter code hereI'm trying to hide asking file dialog when saving any types of file. As we know we need to set in "browser.helperApps.neverAsk.saveToDisk" mime types of all files which we need.

so in my case it looks like:

FirefoxProfile.SetPreference("browser.download.folderList", 2);
FirefoxProfile.SetPreference("browser.download.dir", "d:\\test");
FirefoxProfile.SetPreference("browser.helperApps.alwaysAsk.force", false); FirefoxProfile.SetPreference("services.sync.prefs.sync.browser.download.manager.showWhenStarting", false);
FirefoxProfile.SetPreference("browser.helperApps.neverAsk.saveToDisk", "application/excel");

I'm using mime types from here http://filext.com/file-extension/XLS and got success with "zip", "jpg", "docx", "xlsx" but it doesn't work with "xls", "csv". When i'm trying to dowload "xls" or "csv" firefox asking where to save it.

Any help?

Oleg Strokatyy
  • 631
  • 2
  • 10
  • 23
  • Have you tried seeting the mime-type (application/excel) to the accepted answer (or anything other) like in this post: http://stackoverflow.com/questions/974079/setting-mime-type-for-excel-document – Shion Jan 17 '13 at 12:24
  • Sure i did. Moreover i've looked at registry HKCR/.xls and HKCR/.csv - application/vnd.ms-excel. So i used this mime type. And it doesn't work. – Oleg Strokatyy Jan 17 '13 at 12:36
  • I've looked it through fiddler and got "Content-Type: application/download". This mime type also doesn't work. – Oleg Strokatyy Jan 17 '13 at 12:51
  • Sorry, can't help here anymore. I tried it with every mime-type I know, and even looked up the M$ ones (http://filext.com/faq/office_mime_types.php), but no luck. I tried to set the value directly in the about:config page of Firefox, but it seems that it isn't taken into account. What you could try, is: Create a new Firefox profile, make the necessary changes, locate the profile, and load this profile file directly for your test. That should do the trick hopefully. – Shion Jan 17 '13 at 15:50

1 Answers1

0

I had a similar problem where most CSV files worked for the types I had specified in the config, but one place in particular would not work.

Like the comments above mentioned, I too tried all the ones listed on that other post with no luck.

What I ended up doing was setting the "Always perform this action for this file type" in the file download screen. I then went to the mimeTypes.rdf file in the profile folder in my AppData for FireFox and looked at all the options that had been set.

I found the one in there for Microsoft Excel Comma Separated Value File.

In this case, it's type was listed as:

application/vnd.csv

So I added this and it started working.

Melvalint
  • 1
  • 1
  • This worked for me. The one I was missing was "application/vnd.ms-excel". A short cut to app data is %APPDATA%\Mozilla\Firefox – RMK Jan 28 '15 at 23:15