Firefox Mozilla Relative Path

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
batowiise
Forum Commoner
Posts: 28
Joined: Fri Dec 17, 2010 7:11 am

Firefox Mozilla Relative Path

Post by batowiise »

Hi all,

i have a script that is suppose to allow download i however get an alert from Firefox Mozilla." Firefox doesn't know how to open this address, because the protocol (c) isn't associated with any program" . Upon further investigation, i got to know that "C:/upload_test/$code/$file" is not a registered protocol and that i need to give a relative path to "C:/upload_test/$code/$file".

My code is as follows:

Code: Select all

echo "<center><a href='C:/Upload_test/$code/$file' target='_blank'>Download Attached File</a></center>";
How do i go about the relative path?

Regards
User avatar
awebtech
Forum Newbie
Posts: 21
Joined: Sun Nov 07, 2010 4:54 pm
Location: Russian Federation

Re: Firefox Mozilla Relative Path

Post by awebtech »

Hi, you need to use the "file" protocol in local download links.

The correct code is:

Code: Select all

echo "<center><a href=\"file:///C:/Upload_test/$code/$file\" target=\"_blank\">Download Attached File</a></center>";
Such link works for me in IE.

But FF and Chrome do nothing on click. I have no idea why it is so.
Post Reply