|
-
Jan 29th, 2010, 04:05 PM
#1
Thread Starter
Hyperactive Member
Open a folder with a link
I have a link like so
Code:
file:///Volumes/folder/name/
Is there anyway with javascript to make this folder open when the link is clicked?
I already tried the window.open function, but its not working.
Thanks.
-
Jan 29th, 2010, 04:27 PM
#2
Re: Open a folder with a link
Please don't cross-post. If you don't know whether to post in PHP or HTML, take your best guess and post in one section.
Anyway, you do this the same as any other link, but you need to specify a complete path beginning with the drive letter:
Code:
<a href="file:///C:\Volumes\folder\name\">Click here.</a>
And of course it won't work if that exact folder doesn't exist.
Last edited by SambaNeko; Jan 29th, 2010 at 04:32 PM.
-
Jan 29th, 2010, 04:33 PM
#3
Thread Starter
Hyperactive Member
Re: Open a folder with a link
Sorry for the cross-post.
This doesn't work:
Code:
<a href="file:///C:\Volumes\folder\name\">Click here.</a>
Is it possible that its a security issue which is being blocked by the browser?
-
Jan 29th, 2010, 04:37 PM
#4
Re: Open a folder with a link
Quite probably, yes. The link works for me when used from a local page, but when uploaded to a remote domain, no longer works.
Edit: some Googling suggests that some OS/browser combinations have no trouble opening these types of links (from a remote site), but more modern configurations don't allow them (one person said it worked when they added their domain to "Trusted Sites" in IE). This makes sense to me, as linking to a local drive doesn't really make sense on a hosted web page anyway.
Last edited by SambaNeko; Jan 29th, 2010 at 04:49 PM.
-
Jan 30th, 2010, 09:27 AM
#5
Re: Open a folder with a link
file URLs will only be resolved from pages served from file
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|