• Post Reply Bookmark Topic Watch Topic
  • New Topic

res.setContentType: what is correct for wmv file type  RSS feed

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • 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.

 
Paul Clapham
Sheriff
Posts: 22185
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • 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"
 
dema rogatkin
Ranch Hand
Posts: 294
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks. It really help me. Thanks.
 
Manish Hatwalne
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!