Forum Moderators: open

Message Too Old, No Replies

Linking from a webpage to my documents

         

musicales

4:04 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



I want to create a webpage that I can use privately to access my computer files. I tried do an a href link to
"C:\Documents and Settings\" etc but it didn't work.

Does anyone know how to do this - in other words a link that directs the user to their own file system?

I can't just keep the html file on my computer by the way because I want to do some database accessing on the webpage.

BlobFisk

4:06 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try: file://localhost/C:/path/to/page.html

HTH

musicales

4:34 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



no joy I'm afraid. The link just doesn't work at all (not even an error page). I removed the localhost in your line but still nothing.

I could of course grab my own ip address and browse (assuming I shared my file system) but don't really want to do it that way.

fabfurs

4:40 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



What server are you using?

musicales

4:53 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



IIS
(Don't groan!)

BlobFisk

4:57 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm a little confused, do you want the link to run from a page on your machine to the files on your machine? Is your machine the server, using PWC?

musicales

5:03 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Hi
Sorry, I want to have the file on the remote IIS server and when I view the ASP page with my browser it offers me a link to my local machine which doesn't have PWS or anything.

I basically want to write a little ASP page which accesses a database with some of my personal computer content to allow me to access and browse my own files in my own way.

BlobFisk

5:08 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Technically this should be impossible, as there are inherent restrictions on what a browser can access on a client machine.

However, there is something call HTML Applications (HTA) [webreference.com] that may allow you to do this. It would look something like this:


<HTA:APPLICATION ID="AppRunner"
APPLICATIONNAME="AppRunner"
WINDOWSTATE="normal">
<html>
<head>
<title>...</title>
<script type="text/jscript">

function runEXE()
{
var wshShell = new ActiveXObject("WScript.Shell");
wshShell.Run("file:///c:/path/to/file.exe", 1, false);
self.close();
}

</script>
</head>
<body>
<script type="text/jscript">
runEXE();
</script>
</body>

HTH

musicales

5:23 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



thanks that looks good. Do you know how to not run a file but just browse a directory?
Thanks again

BlobFisk

5:28 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Directory browsing is a setting on your server which would allow you to view the directory contents on a servers folder. However, I don't think that it is possible for a page on a server to view a directory on a client machine.

musicales

5:34 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



it seems annoying because I can of course paste the C:/My Documents line into my browser so why doesn't it work when I create it in a link.

Never mind, thanks for your help.

fishy

2:38 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



musicales,

Try using the following code within your htm page:

IFRAME SRC="\\127.0.0.1\My Documents\or\the\folder\you\want\ width="100%" height="450"></IFRAME>

best.

michaelbs

2:49 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



Not sure if this will help but if you put your ip address of server in your local hosts folder on your local machine it may work.

As i said im not sure if this will work but i was shown this a while ago and i could comunicate with my server and vice versa when i did this.

fishy

2:57 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



if you are going to put this code on a different machine then yours, then simply change 127.0.0.1 to your machine name.

certainly this will only work if your machine and the server are on the same network.

IFRAME SRC="\\127.0.0.1 or machine name\My Documents\or\the\folder\you\want\ width="100%" height="450"></IFRAME>

musicales

3:37 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



I'm using this thing to browse my music collection. If I did used 127.0.0.1 wouldn't it try to download a new copy of the file and clog up my temp folder or something? Also, I'd have to have my file system shared then which would be a security risk I would have thought.

fishy

3:50 pm on Feb 11, 2004 (gmt 0)

10+ Year Member



If I did used 127.0.0.1 wouldn't it try to download a new copy of the file and clog up my temp folder or something?
--> i don't believe so. all that happens is that the contents of the folder you map will be displayed within the <i frame>.

Also, I'd have to have my file system shared then which would be a security risk I would have thought.
--> if the server is on a different machine then yours and on your network, then you will have to share the folder. but you can constrain your sharing to only that folder.