Click here to Skip to main content
15,314,594 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
<audio controls>
  <source src="horse.ogg" type="audio/ogg">
   <source src="D:/nameoffolder/${uname}/1.mp3" type="audio/mp3">
   <source src="C:/Users/Downloads/Linkin Park_in_the_end.mp3" type="audio/mp3">
        Your browser does not support the audio element.

here I cannot use

this is my jsp page. ${uname} does not get the fetch the session value at runtime.
if I just write ${uname} it prints the session value.
Richard Deeming 17-Sep-15 9:56am
Your HTML is invalid. You cannot access local files on the user's hard-drive from a website. The src attributes need to point to valid URLs, not local paths.
Member 9671810 17-Sep-15 10:18am
But this is my college project, so you think to make a webserver and upload my files there? and access from there? is it feasible.?
Dev O'Connor 17-Sep-15 17:20pm
Yes, this would be the best way, you can either reference them either via the local directory of the server itself (if you upload to the same site your site is hosted on) or you can reference the src to the URL of the uploaded file.

Both will be sufficient.
Mohibur Rashid 18-Sep-15 3:44am
not necessarily, you use relative path
say your project is in

Your server will access your page

i.e if your server is localhost
and you request
server will look the musicloader.ext as
now create a folder in
name it music

source would be

if you use vairous user name as folder, then

and the files will reside in

now, figure it out.
Member 9671810 18-Sep-15 23:52pm
I tried this one. but it ain't working. Still invalid source.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900