Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with accessing mp3 file in tomcat

 
Pradeep Settipalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Pradeep Settipalli
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I assume you've double checked the spelling of the file's name; including case.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic