Meaningless Drivel is fun!
The moose likes Servlets and the fly likes downloading the video Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "downloading the video" Watch "downloading the video" New topic

downloading the video

saravanan ragunathan
Ranch Hand

Joined: Aug 02, 2010
Posts: 84

when i create the simple web application ..i tried to dwonload the video(.avi)
from tomcat by setting the content type as (video/quicktime) 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

"I Love Java Ranch"
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

an avi is mime-type "video/x-msvideo"
You can define the file name using
Naren Chivukula
Ranch Hand

Joined: Feb 03, 2004
Posts: 577

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.
1. No user intervention to download.
2. Fairly quick to download.
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.
1. Can download bigger files.
1. User intervention is required.

(OCEEJBD6, SCWCD5, SCDJWS, SCJP1.4 and Oracle SQL 1Z0-051)
I agree. Here's the link:
subject: downloading the video
It's not a secret anymore!