I ran into same issue using selenium, im making the assumption that when that box pops up you always wish to download it correct?
I ended up running my selenium through firefox and created a custom firefox profile in order to run it. In doing so i was able to say any file type of CSV automatically save it to c:\temp directory.
Here is my below MimeTypes.rdf and preferences.js for firefox. Using selenium you have the ability to run selenium using a custom firefox profile, this is well documented and plenty of examples on the internet that you should be able to easily find. A quick search found this link for example:
http://garbuz.com/2010/07/31/running-selenium-with-custom-firefox-profile/[
^]
mimeTypes.rdf (defines what files you want to auto download)
<rdf:rdf xmlns:nc="http://home.netscape.com/NC-rdf#" xmlns:rdf="#unknown">
xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:description rdf:about="urn:root">
NC:en-US_defaultHandlersVersion="3" />
<rdf:description rdf:about="urn:mimetype:application/vnd.ms-excel">
NC:value="application/vnd.ms-excel"
NC:editable="true"
NC:description="CSV document"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<nc:fileextensions>csv</nc:fileextensions>
<nc:fileextensions>xls</nc:fileextensions>
<nc:fileextensions>xlb</nc:fileextensions>
<nc:fileextensions>xlt</nc:fileextensions>
<nc:handlerprop rdf:resource="urn:mimetype:handler:application/vnd.ms-excel" />
</rdf:description>
<rdf:description rdf:about="urn:mimetype:handler:text/csv">
NC:saveToDisk="true"
NC:alwaysAsk="false" />
<rdf:description rdf:about="urn:mimetype:text/csv">
NC:fileExtensions="csv"
NC:description="CSV document"
NC:value="text/csv"
NC:editable="true"
NC:alwaysAsk="false"
NC:saveToDisk="true">
<nc:handlerprop rdf:resource="urn:mimetype:handler:text/csv" />
</rdf:description>
</rdf:description></rdf:description></rdf:rdf>
preferences.js (you can basically take your current profile in firefox and add these two lines to it)
user_pref("browser.download.dir", "C:\\temp");
user_pref("browser.download.folderList", 2);