Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Servlets and the fly likes Error while dowloading a movie from server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Error while dowloading a movie from server" Watch "Error while dowloading a movie from server" New topic
Author

Error while dowloading a movie from server

ajay vasudevan
Greenhorn

Joined: Apr 23, 2005
Posts: 21
the above exceptions occur while i try to view a mpeg file by using servlets.the mpeg file resides on the server.i used res.setContentType("video/mpeg"),got an Inputstream from ServletContext, got an outputstream and wrote the bytes.

but getting the Exception while opening the file at the client.
ClientAbortException;java.net.SocketException,Connection reset by peer.
socket write exception at line .....

the line is
sos.write(bytes,0,data);


i changed the contentType as setContentType("video/mpeg"),but the file couldn't be recognized at the client.it shows blank at filetype so the user has to choose from the type of program to open the file.


i want the foll scenario.

when the page is submitted ,the file gets downloaded automatically and can view in the browser itself.(or the concerned the media player )

please do help me with this dilemma.

rgds,

ajay vasudevan
scjp 1.4
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while dowloading a movie from server
 
Similar Threads
Error while downloading mpeg file from server
video in java
Get File Type
JAVA APIs to parse MP4 file
Create AVI/MPG from BMP images