• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

problem with accessing mp3 file in tomcat

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic