Solved

HTML Link to Open Folder on Current User's Desktop

Posted on 2014-04-09
7
626 Views
Last Modified: 2014-04-09
We have a web interface that loads on laptops.  It's a launch point for many apps we use.

I need to discover a link that will open a folder on the current user's desktop.

The folder is called "Dept Apps"

How can we do this?

Thanks..

David
0
Comment
Question by:DWStovall
7 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39989525
You probably can't.  Current browser security prevents you from accessing the local machine from a page that was loaded from a web site.  You might be able to do it with IE (Internet Explorer) if you have all the permissions right but no other browser will let you do that.
0
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39989531
Link to "C:\Users\%username%\Desktop\Dept Apps"

Link need the quotation marks " since there is an empty space in it.
0
 
LVL 19

Expert Comment

by:Patricksr1972
ID: 39989538
I tested this simple piece of code and it opens my desktop (since here is no folder Dept Apps

<html>
<head> test
</head>

<body>
<a href=""C:\Users\%username%\Desktop\Dept Apps"">Link text</a>
</body>
</html>

Open in new window

0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39989562
But does it open when you load it from a web server instead of from you local files?  That's what the security restriction is about, preventing remote sites from getting into your computer.  There are some methods available in IE and AD with Sharepoint apparently, but not from just any web server and browser.
http://code.google.com/p/browsersec/wiki/Part2
0
 

Author Comment

by:DWStovall
ID: 39989900
@ Patricksr1972,

I tried the simple piece of code, and I got the same response - even with a few variations, all it would open is the "Desktop" folder.  It shows the "Dept Apps" folder, but it won't open it.

This is a launch page from one of our local internal (intranet) servers.  It's not coming from an outside entity - it's a "trusted site".  Folks use this website as a link point to PDF documents, other web pages, etc.  Why can't it open a folder on the desktop?

Thanks for your response.
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39989997
In this case, anything that is loaded with 'http://' is not allowed to load anything with 'file://' because it is a security risk.  Your browser can't tell that it is trusted unless you're using a version of IE that includes that function.  In addition, I don't think your user permissions that give you access to your desktop are transferred to operations in your browser.

Links to other pages and PDF's on the server are under different security permissions.  They would be 'http://' links which are ok to open from pages that are loaded using 'http://'.
0
 
LVL 52

Expert Comment

by:Scott Fell, EE MVE
ID: 39990678
I know this is after the fact, but you can use a java applet to do this.  

http://docs.oracle.com/javase/tutorial/deployment/applet/security.html
Sandbox applets cannot perform the following operations:
They cannot access client resources such as the local filesystem, executable files, system clipboard, and printers


Privileged applets do not have the security restrictions that are imposed on sandbox applets and can run outside the security sandbox.

I currently use an applet to access a local printer programatically.  

I am not a java dev and have not verified these links  and only did a quick search but some examples below.*

http://www.coderanch.com/how-to/java/HowCanAnAppletReadFilesOnTheLocalFileSystem

http://faculty.kutztown.edu/spiegel/CSc421/SigningAnApplet.htm

*In order to prevent the browser from throwing an error, you must get a certificate for your applet http://docs.oracle.com/javase/tutorial/deployment/doingMoreWithRIA/security.html
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article offers some helpful and general tips for safe browsing and online shopping. It offers simple and manageable procedures that help to ensure the safety of one's personal information and the security of any devices.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question