Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get file extension?

 
Siripa Siangklom
Ranch Hand
Posts: 79
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A content-type/mime-type to file extension mapping is ambiguous. For example:
image/jpeg can be .jpg or .jpeg file.
How to get file extension exactly from content type?
 
Frank Carver
Sheriff
Posts: 6920
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no way to do this. In fact, there is no particular reason why a file should even have a file extension.
Can you explain a little more about what you are trying to achieve by doing this? It's quite likely we can come up with alternative solutions.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic