Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

downloading the video

 
saravanan ragunathan
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

when i create the simple web application ..i tried to dwonload the video(.avi)
from tomcat by setting the content type as (video/quicktime) ..it gets downloaded
but my system shows it as unkown file format and the file name is very strange
is there any facility to include the file name and type with the response


 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
an avi is mime-type "video/x-msvideo" http://www.w3schools.com/media/media_mimeref.asp
You can define the file name using
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Saravanan,
i tried to download the video(.avi)

I see you are trying to download the video within your application. I'm not sure if you considered pros and cons of this way.
Pros:
1. No user intervention to download.
2. Fairly quick to download.
Cons:
1. Downloadable file size is limited.


You can also download by directly accessing the file from the server using "Get" request. Say if you want to download "sample.avi", then invoke http://<server-host>:<port>/<app-name>/<path>/sample.avi. This will prompt java script pop-up box in your application to download wherever you wish.
Pros:
1. Can download bigger files.
Cons:
1. User intervention is required.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic