Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Opening .torrent files for download in java  RSS feed

 
Lance Walker
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi hopefully this will be an easy question to answer.
I've finished coding an applet that can be used to download files. However I do not wish for the files to be downloaded directly to the drive and I want the user to be able to select where to save the file using the NATIVE open/save browser feature (not JfileChooser). To do this, I used the following code, where targetURL is a string containing the full HTTP file path:




When I tested the applet out on both IE and Firefox (in these tests, absolute permission was granted to the applet to the local system through a digitial certificate), the applet opened the open/save file dialog perfectly in both browsers when downloading a .EXE file. However, when downloading a .torrent file (essential feature to the applet) only the IE dialog popped up. In firefox, a new windows is opened and a textual representation of the .torrent file is displayed, and looks much like if you were to open a picture file with a notepad. I am utterly baffled by this . Firefox has no problems downloading .torrent files through its interface, but for some reason when an applet is run it cannot seem to recognize the .torrent file. Is there any way around this? I would assume this might be a common problem for files other than .torrents or with other browsers, but I can't seem to find a google solution.

Any and all help is appreciated. I'll provide additional details/code as is needed.
 
Joe Ess
Bartender
Posts: 9406
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Firefox, click on Tools menu, select Options, then click on the icon marked "Applications". This is where Firefox associates an application with a file extension. Is there anything configured for Torrent files?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!