TheSafehouse



A good friend will come to bail you out of jail after you did something stupid, a true friend will be sitting in the cell next to you saying, 'That was Awesome!'.




Safehouse Forums



Safehouse Site Info



 

The end is nigh


 

 

 







FAQ Members List Calendar Mark Forums Read

Reply
 
Thread Tools
ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
IE is downloading .jar files as .zip
Reply With Quote   #1

I have this web page that has links to download some .jar files. When I click on it in IE, it saves it as a .zip file. I can right click it and select Save As, then I can change the extension back to .jar, but thats not really convienent for my users.

When I use Firefox, it saves it correctly as .jar.

Any suggestions?


Hordolin Awanagin
Hordolin Awanagin is offline
Veteran

Join Date: Feb 2002
Location: TX


Hordolin Awanagin's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #2

associate .jar with java instead of Compressed (zipped) folder


ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #3

How do I do this? I looked under Tools->Internet Options, but I dont see anything that specifies association types.


Nocte
Nocte is offline
n00b!

Join Date: Apr 2002
Location: Manchester, NH


Nocte's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #4

Open any folder on your machine.

Select Tools Folder Options from the drop menus.

Click the File Types tab.

See image.
Attached Images
File Type: jpg FolderOptions.jpg (74.2 KB, 10 views)


innur
innur is offline
Registered Member

Join Date: Apr 2004
Location: Oak Harbor, WA


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #5

ladrona said:
I have this web page that has links to download some .jar files. When I click on it in IE, it saves it as a .zip file. I can right click it and select Save As, then I can change the extension back to .jar, but thats not really convienent for my users.

When I use Firefox, it saves it correctly as .jar.

Any suggestions?


Found ur problem. Your using IE!

FireFox makes the pain stop



Innur Darkpoker

"if water was vodka and i was a duck i'd swim to the bottom and never come up, but water ain't vodka and im not a duck so pass me the bottle and shut the F*@# up." -jenn
ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #6

Nocte said:
Open any folder on your machine.

Select Tools Folder Options from the drop menus.

Click the File Types tab.

See image.
In my Folder Options I have Jar associated as an Executable Jar File. See image.

I tried changing that to be associated with jar.exe and restarted IE. It didn't make any difference, still got the same problem. :(

So just for grins I changed jar to be associated with winrar. IE still thought it was downloading a .zip file. So then I go into Windows Explorer and double clicked on the jar file. It opened it up in winrar.

So I'm guessing that Folder Options is not looked at on downloads but only when its opened up a file. Does that sound right? or am I doing something else wrong? Any other suggestions?
Attached Images
File Type: jpg jar.JPG (35.1 KB, 2 views)


Nocte
Nocte is offline
n00b!

Join Date: Apr 2002
Location: Manchester, NH


Nocte's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #7

Yep. You're probably right. I was just showing how to change the associations. It sounded like the obvious fix for me too, Hordolin.

I don't know the answer personally. I've never downloaded *.jars before.


Nocte
Nocte is offline
n00b!

Join Date: Apr 2002
Location: Manchester, NH


Nocte's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #8

Now I'm thinking it is a file association issue somewhere. I'm using IE7 Beta 3 and I just tried to download this *.jar (no idea what it is, but wanted to test).

Downloaded fine for me. I didn't even have to change the "Save As" extension, it was there at default when the window popped up...
Attached Images
File Type: jpg JarDownload.jpg (64.9 KB, 4 views)


ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #9

Hmm, interesting. I tried downloading that same asm.jar file and it worked ok for me. I wonder if theres a difference between http and https which is what I'm using.

This gives me something to play around with. Thanks!


ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #10

How do I add mime types to IE 6?


Blusco
Blusco is offline
Veteran

Join Date: Jul 2002
Location: Seattle, WA


Blusco's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #11

ladrona said:
How do I add mime types to IE 6?
I don't know how to add them, but you're on the right track. This is most likely related to the mimetype that each file presents.


Hordolin Awanagin
Hordolin Awanagin is offline
Veteran

Join Date: Feb 2002
Location: TX


Hordolin Awanagin's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #12

Correct me if I'm wrong but it's only doing .zip from this one particular site?
If so, it looks to be their end forcing them to .zip (on the fly compression or the href text says blah.jar but the actual href points to blah.zip *shrug*

Anyway. for mime types...
Take a look at the registry in HKEY_CLASSES_ROOT/.jar
this is where it's defined. Even with java installed that .jar should be empty (nothing but a blank default entry)

for example, to add a mime handler for a .msc file you'd put a .msc entry in HKEY_CLASSES_ROOT and define the action it takes.

Code:
REGEDIT4 [HKEY_CLASSES_ROOT\.msc] @="MMCFile" "Content Type"="MSC/Application" [HKEY_CLASSES_ROOT\MMCFile] @="Manage Console file" "EditFlags"=hex:00,00,00,00 [HKEY_CLASSES_ROOT\MMCFile\Shell] @="" [HKEY_CLASSES_ROOT\MMCFile\Shell\open] [HKEY_CLASSES_ROOT\MMCFile\Shell\open\command] @="%systemroot%\\system32\mmc.exe %1" [HKEY_CLASSES_ROOT\MIME\Database\Content Type\MSC/Application] "Extension"=".msc"


ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #13

Hordolin Awanagin said:
Correct me if I'm wrong but it's only doing .zip from this one particular site?
If so, it looks to be their end forcing them to .zip (on the fly compression or the href text says blah.jar but the actual href points to blah.zip *shrug*
No the html page is ok. It downloads just fine with firefox. And View Source of the page has the href pointing to the jar file.

Thanks for the tip about the registry entries! I'll play around with that.


Nocte
Nocte is offline
n00b!

Join Date: Apr 2002
Location: Manchester, NH


Nocte's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #14

It is an oddity for sure. I've poked around a bit this afternoon and came up with...

This and this .


Chromite
Chromite is offline
Veteran

Join Date: May 1999


Chromite's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #15

ladrona said:
I have this web page that has links to download some .jar files. When I click on it in IE, it saves it as a .zip file. I can right click it and select Save As, then I can change the extension back to .jar, but thats not really convienent for my users.

When I use Firefox, it saves it correctly as .jar.

Any suggestions?
What's the URL of the page with the .jar files?

Try and see how Internet Exploder handles this jar file: http://www.schrade.com/firefox/theme...able-1.0.2.jar

If it handles it ok, it might be related to IE's mimetype sniffing and the page you're trying to download your jar files from has their mimetype set incorrectly.

.jars should be set to application/java-archive and if a site is sending it as text/plain, IE might go into its sniffing mode, see that it's a zip and append the .zip extension to it.

Yup. Just tested it with IE. That's the reason for it.

If it's your site just add this mime type to your main .htaccess file:

AddType application/java-archive jar



Chromite
Chromite is offline
Veteran

Join Date: May 1999


Chromite's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #16

So, uh.. did that fix it? What's the status?


ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #17

Sorry about that, I got side tracked.

I created an .htaccess file and added the AddType. It didn't make a difference. So I put an 'IndexIgnore *' to see if it would work. It didn't. So I think they either turned it off or use a server that does it different.

I'm still playing around with the registry entries. There seems to be different ways to define Content-Types. So I'm trying different combos to see if I can get one of them to work for me.


Chromite
Chromite is offline
Veteran

Join Date: May 1999


Chromite's Avatar

 
Re: IE is downloading .jar files as .zip
Reply With Quote   #18

ladrona said:
I created an .htaccess file and added the AddType. It didn't make a difference. So I put an 'IndexIgnore *' to see if it would work. It didn't. So I think they either turned it off or use a server that does it different.
Ah you need to add one more thing to your .htaccess to make it work. I didn't realize you had none at all. You need to add "Order deny,allow" in there before the AddType entry to make it work. This also is only for an Apache based server... if your website is running on IIS or something, I have no clue where you need to change the mimetypes. IIS is evil so I avoid it.

Better just stick this whole block in there.. it handles a bunch of extensions.

Code:
Order deny,allow AddType application/java-archive jar AddType application/pdf pdf AddType application/postscript ai eps ps AddType application/smil smil smi sml AddType application/x-httpd-php php php4 AddType application/x-macbinary bin AddType application/x-ms-wmv wmv AddType application/x-shar shar AddType application/x-tar tar AddType application/x-xpinstall xpi AddType application/x-zip-compressed zip AddType application/zip zip AddType audio/basic au snd AddType audio/x-aiff aif aiff aifc AddType audio/x-midi mid midi AddType audio/x-mpeg mp2 mp3 AddType audio/x-mpegurl m3u AddType audio/x-ms-wma wma AddType audio/x-pn-realaudio ram ra rm AddType audio/x-pn-realaudio-plugin rpm AddType audio/x-wav wav AddType image/gif gif AddType image/jpeg jpeg jpg jpe AddType image/png png AddType image/x-ms-bmp bmp AddType image/x-portable-anymap pnm AddType image/x-portable-bitmap pbm AddType image/x-portable-graymap pgm AddType image/x-portable-pixmap ppm AddType image/x-rgb rgb AddType image/x-xbitmap xbm AddType image/x-xpixmap xpm AddType text/css css AddType text/plain txt AddType text/xml rdf AddType video/mpeg mpeg mpg mpe AddType video/quicktime qt mov AddType video/x-flv flv AddType video/x-ms-asf asf asx AddType video/x-msvideo avi AddType video/x-ms-wmv wmv


ladrona
ladrona is offline
Registered Member

Join Date: Apr 2004


 
Re: IE is downloading .jar files as .zip
Reply With Quote   #19

It turns out that the server has 'AllowOverride None' so I can't use .htaccess. I'm going to look into changing servers. Thanks for all the help!




Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump







 
All times are GMT -7. The time now is 04:10 AM.
All posts are
© Copyright 2004-2006 The Safehouse Network