aspose file tools*
The moose likes Tomcat and the fly likes problem with accessing mp3 file in tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "problem with accessing mp3 file in tomcat" Watch "problem with accessing mp3 file in tomcat" New topic
Author

problem with accessing mp3 file in tomcat

Pradeep Settipalli
Greenhorn

Joined: Dec 15, 2006
Posts: 5
Hello All,

I have a problem embedding a mp3 into a html page and accessing it from tomcat.
I used the below tag to embed my mp3 onto the html page(index.html)
<EMBED SRC="1.mp3" AUTOSTART="true">
and I placed my 1.mp3 in the root of the webapplication directory called audiodir. But when I try to access it through the web server ( as http://localhost:8080/audiodir), it says that http://localhost:8080/audiodir/1.mp3 not found

Can some one please let me know what went wrong?

Thank you very much in advance.
Praveen
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I don't think this has anything to do with the file being an MP3.

You created a folder inside tomcat/webapps named audiodir?
If so, did you create a WEB-INF directory inside your audiodir folder?
If not, Tomcat will not recognize that folder as a web application.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Pradeep Settipalli
Greenhorn

Joined: Dec 15, 2006
Posts: 5
Thank you Ben, for the reply.

But I do have the WEB-INF folder and infact, If the same static html page has a link which refers to a pdf file instead of a mp3 it works fine.

Only when the link points to a mp3 file, tomcat says "The requested resource(/audiodir/1.mp3) is not available"

So I thought it had something to do with the file being mp3.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

I assume you've double checked the spelling of the file's name; including case.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Also...
Try creating a plain old hyperlink to the file and see if you can download it that way. If you can, then you know the issue is not Tomcat; that it's a problem with your client side code (embed tag).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem with accessing mp3 file in tomcat
 
Similar Threads
404 - Page not found ??
HFS: Problem with deploying and testing Beer-v1 App
how to get console window in Jboss3.0.2?
Servlet not called - Error in web.xml
Head First Sample Code