![]() |
![]() |
![]() |
|||||
![]() |
![]() |
![]() |
![]() |
![]() |
|||
| Welcome
to Tech Support Forum home to more then 136,000 problems solved. Issues
have included: Spyware, Malware, Virus Issues, Windows, Microsoft,
Linux, Networking, Security, Hardware, and Gaming Getting your
problem solved is as easy as: 1. Registering for a free account 2. Asking your question 3. Receiving an answer Registered members: * See fewer ads. * And much more..
|
| Want to know how to post a question? click here | Having problems with spyware and pop-ups? First Steps |
|
|||||||
| Web Design & Programming Discussion of web design, and server-side & client-side scripting |
![]() |
|
|
LinkBack | Thread Tools |
|
|
#21 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,888
OS: Vista, various linux distros
|
Re: Link to computer files
Neither's dm01 he's just covering all the bases. You clearly have something up on your computer, it's not a problem with the code but the way your computer's handling opening the MP3 file. Without having your computer we can't work this out.
A possible work around is to use a flash based mp3 player on the webpage... e.g: http://www.flashmp3player.org/ Other than that there's not a lot we can do. |
|
|
|
| Important Information |
|
Join the #1 Tech Support Forum Today - It's Totally Free!
TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free. Join TechSupportforum.com Today - Click Here |
|
|
#22 (permalink) |
|
Moderator: Design
Join Date: Oct 2006
Location: Richmond, B.C.; Canada
Posts: 1,475
OS: Windows XP [Version 5.1.2600] SP3 | Ubuntu Jaunty Jackalope | Windows 7 Ultimate (MSDNAA I <3 you)
|
Re: Link to computer files
You'd be surprised how many people call tech support because their computer didn't work, only to find they had forgotten to plug it in.
Have you specified the MIME for the mp3 file as audio/mpeg?
__________________
![]() Validate your Markup Validate your CSS Notepad++ Please use [html], [php], and [code] when posting code or markup. I do not help by Private Message or e-mail. If for some reason I have over-looked a reply to a thread that I have previously replied to, then send me a message. |
|
|
|
|
|
#23 (permalink) |
|
God (TSF Enthusiast)
Join Date: May 2009
Location: Jeffersonville, IN
Posts: 905
OS: Ubuntu 9.10 [Karmic Koala]
|
Re: Link to computer files
Is there a space in the file/directory name? Any of them? If so, replace those with %20 and if there are other characters a browser can't parse I suggest you change those their equivalent.
|
|
|
|
|
|
#24 (permalink) |
|
Registered User
Join Date: Oct 2009
Posts: 45
OS: VistaPremium
|
I have sort of figured out the problem. Thanks everyone. Also thank you ahmorrow, although it's not what you said it lead me to the solution... But this is not fully resolved yet.
When I link to a an mp3 file in a folder like Documents or Music it works. But when I link to an mp3 file inside a folder on those folders it doesn't work anymore. I was linking to a folder inside a folder the hole time. Why does it not work? C:\Users\User\Music\File.mp3 - Works. C:\Users\User\Music\Folder\File.mp3 - Doesn't work. |
|
|
|
|
|
#25 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,888
OS: Vista, various linux distros
|
Re: Link to computer files
Them URLs make no difference, what is the exact url of the folder you were inside? did it contain spaces or non-alphanumeric characters?
This kinda made me laugh because dm01's post was probably the most relevant to the solution. |
|
|
|
|
|
#27 (permalink) |
|
Design Team Member
Join Date: Jul 2007
Location: Coventry, UK
Posts: 1,888
OS: Vista, various linux distros
|
Re: Link to computer files
so what was it? there must be some reason. File permissions of the folder set correctly? Having another level in the folder structure shouldn't make any difference at all...
|
|
|
|
|
|
#28 (permalink) |
|
Design Team Member
|
Re: Link to computer files
What are you expecting to see? It seems like this is one of those situations where our expectations of how a web page works differs from what you're expecting...and we need to establish exactly what you want to get out of this in order to really help without driving each other crazy :)
__________________
Free Resources PC Protection - Comodo Firewall | AVG Anti-Virus | WinPatrol | Ad-Aware | Spybot S&D | SpywareBlaster |Web Design/Programming - KompoZer (Editor) | Paint.NET (Graphic) | GIMP+GIMPShop (Graphic) | FileZilla (FTP Client) | Free Hosting | |
|
|
|
|
|
#29 (permalink) |
|
God (TSF Enthusiast)
Join Date: May 2009
Location: Jeffersonville, IN
Posts: 905
OS: Ubuntu 9.10 [Karmic Koala]
|
Re: Link to computer files
Try this. Have the file on your desktop, and change the folders after all the ../../'s to the correct path. That is, treat the../../'s as C:\ or file://C:\
.. means go up a directory and / is a folder denoted in any url. Just make sure there are no spaces in your username or the file and there are no special characters like the following: ) ( * & ^ % $ # @ ! } { " : ? > < , [ ] ' ; as they WILL screw with the way your file is opened--meaning it won't. HTML Code:
<a href="http://www.techsupportforum.com/users/user/music/folder/file.mp3">WhoCares.mp3</a> HTML Code:
<a href="file://C:\Users\User\Music\File.mp3" onerror="window.alert('file missing')">WhoCares.mp3</a> |
|
|
|
|
|
#30 (permalink) | |
|
God (TSF Enthusiast)
Join Date: May 2009
Location: Jeffersonville, IN
Posts: 905
OS: Ubuntu 9.10 [Karmic Koala]
|
Re: Link to computer files
A few rules:
The file MUST be on the computer the web page is on. The only exception to this is if the file is native to other computers as well. Such as calculator, or command prompt. The file must either be located as previously suggested by many others: Code:
file://c:/folder/file.extension Quote:
A url is always defined as such: transfer-protocol:// host-name. sub-domain. domain. top-level-domain/ directory/ file. extension Transfer-Protocol: ftp, http, https, file, gopher, telnet, news. Host-name: www+sub-domain Sub-Domain: Can literally be anything. Top-Level-Domain: ahmorrow, aero, biz, coop, edu, com, info, gov, mil, museum, net, org, pro, ar, au, ca, ch, cl, cn, de, ds, mx, uk, us (denotes--usually--organization, or country/language). These can also be used in combination with cc, tec, lib, k12, state, mus (to further differentiate the organization type). Directory: A folder. File: Name of the file. Extension: html, htm, doesnotexist, jpg, gif (the list is actually pretty huge). So technically speaking, if the server for some place was set up to use it you could use this as a url. Code:
news://www.ahmorrow.techsupportforum.pro.us/this/page/does/not/exist/../../../oops/went/too/far/../../../../../not/mp3-playlist.jpg Code:
news://www.ahmorrow.techsupportforum.pro.us/this/page/does/not/mp3-playlist.jpg Now then, onto the rest of my little tutorial. You can't use special characters or spaces, that's why everything that DOES have a space is replaced by it's HEX value. ' '--space--is known as %20 as an example. That's why Vista did away with the 'Documents and Settings' folder--I assume. It wouldn't work without changing the space to it's hex value. The directory for your music folder would be: Code:
C:\Users\[YOUR-USERNAME-HERE]\Music HTML Code:
<a href="file://c:/users/ahmorrow/music/artist-folder/album-folder/track.mp3">
NOTICE: No file:// is needed in this situation. HTML Code:
<a href="../music/artist-folder/album-folder/track.mp3">
Now, if you need any more help, your registry is REALLY messed up, your associations are simply screwed up beyond recognition, or you're just not getting this.
|
|
|
|
|
![]() |
| Thread Tools | |
|
|