• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

res.setContentType: what is correct for wmv file type

 
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This headache has made me sleepless for a while.

I allow people to download file from my server. After I got this request, I read file into byte[] and then send it out with ServletOutputStream. Coding below is sending out wmv file to user.

Now the problem, the user browser can't read the file type, which is empty, so I have to add a file type to that downloaded file, say , from "ddd" to "ddd.wmv", then it will work.

But this is not a good solution. I guess the problem is res.setContentType("video/wmv"), but what is correct ContentType for wmv file type ? Where I could find a MIME table for this ? or my guess is totoally wrong ?

Thanks.

 
Marshal
Posts: 28220
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did a Google search for the keywords "mime wmv". The second link that Google returned was Microsoft's support site where it said

"The MIME type for a WMV file is video/x-ms-wmv"
 
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
msn search shows it as 5 link only
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. It really help me. Thanks.
 
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In addition, send "Content-disposition" header with filename parameter. That way you can also allow your users to have filename to save (it works in FireFox).

- Manish
 
pie. tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic