You need to set the MIME type in the response headers.  See
http://www.w3.org/Protocols/rfc1341/4_Content-Type.html  For example:

    String contentType = "audio/mpeg"; // for .mp3 file
    response.setContentType(contentType);

You should be setting the content type for your other files, also.
Windows Explorer will guess at the file type based on the file extension
(actually, it often just passes it to the OS and lets it guess the
type), but most browsers follow the standards on this.

 - George
   http://www.idiacomputing.com

> -----Original Message-----
> From: Jean-Charles Giardina [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, November 29, 2005 9:02 AM
> To: Struts Users Mailing List
> Subject: Re: Play an audio file
> 
> 
> 2005/11/29, Vijaya S <[EMAIL PROTECTED]>:
> > Hi,
> >
> > I have a situation where I need to open a file (File can be text, 
> > Audio/ or video). All kinds of text files are opening up 
> okay(Image, 
> > PowerPoint, Word etc). If the file is an audio instead of 
> opening the 
> > file using Windows Media Player, it is throwing up some junk. Can 
> > anyone help me how do I go about for this situation?
> 
> I think you must make a Java applet to play media content.
> See JMF API at Sun.
>     
> http://java.sun.com/developer/technicalArticles/Media/mediafra
mework/index.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to