Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

What Is The Accepted Content-type for JAR Files?

 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I can't believe it.
mycgiserver.com, a JAVA server (free) service is serving the JAR (Java Archive) files with Content-Type: text/plain !!!
This is what the program that I wrote returns for a JAR file in said server:

Is anyone here a Java server admin that can tell me what is the convention to use (before I go to Sun's site and look for a JAR file!) I will then report the bug to mycgiserver.com.
Needles to say, some browsers will try to display the JAR file as text on the screen, producing garbage as expected. I want the File/Save dialog box to appear instead, as it does with ZIP files, which is how I have been getting around the problem. I am just tired of having to rename *.JAR to *.ZIP as workarounds.
I expect that ignorance from say, GeoCities.com but not from a JAVA service!
Thanks!
PS: The Content-Type: for a ZIP file from that server is application/zip.
[ May 18, 2002: Message edited by: Tony Alicea ]
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is nothing to do with mycgiserver.com.
It's your own program which could not tell what the MIME type of .jar bolongs to.
 
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think that Ming Chen is probably right about it not being a problem with the server unless your program is actually getting the Content-Type header.
The place to look for Mime-Types is: ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/media-types
Looking there, I don't see an entry for jar files, so I would use the same one as for zip.
 
Ranch Hand
Posts: 346
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
application/octet-stream or application/java-archive or something similar would have been more appropriate
And i agree with Tony . Mycgiserver guys are expected to map content-type for jar-files in their web-server's conf ( do they use apache? )
[ At least the default for jar should have been a binary type instead of text/plain ]
And i do NOT think that Tony's program is the actual culprit , as Ming or David opined.
 
Those are the largest trousers in the world! Especially when next to this ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic