Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
audio.src = "file://///PCNAME/Songs/ABC.mp3";

when I click on play button it give me following error that

"Not allowed to load local resource"

Please help me I need to play from other drive of pc
Posted
Comments
Richard MacCutchan 16-Feb-15 4:28am    
You cannot access local resources from a browser.

1 solution

The code you wrote runs inside the browser at the client machine...To ensure a certain level of security you can not do things that can harm the end-user, one of them is reading (or accessing in any form) the local storage of the client machine...
file:// protocol try to do exactly that!
I imagine that what you meant is the local storage of the server machine where, however you switched context so it is not valid anymore...
You should expose the folder with the files via your web site and declare the src attribute as a valid URI...
 
Share this answer
 

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