• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

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.

 
Sheriff
Posts: 28360
99
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
 
See ya later boys, I think I'm in love. Oh wait, she's just a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic