Page 1 of 2

How to link to clients C drive?

Posted: Wed Mar 02, 2005 4:32 am
by lauraSatellite
Hi,

I have a website, that when viewed on the server looks fine, but when viewed from a client machine, doesnt work.

I have a link on one page, which when clicked, i want it to open the c drive of whatever machine is viewing it. Right now nothing happens when i click the link from a client machine, as its trying to open the servers c drive.

Does anyone know how to link to a clients C drive?

ANY input would be greatly appreciated.
thanks

Posted: Wed Mar 02, 2005 4:40 am
by CoderGoblin
You cannot. If you think about it logically this would be a security nightmare. If you can access the C drive you can access the Windows System Directory.

Posted: Wed Mar 02, 2005 4:55 am
by n00b Saibot
and I would only like to delete a few files and your system goes KABOOOOM!!

Posted: Wed Mar 02, 2005 9:42 am
by feyd
you can link to their hard drive just fine.. the server can't access it however.

file:///c:/ anyone? ;)

Posted: Wed Mar 02, 2005 10:53 am
by Wayne
thats right, using the file type instead of an http or ftp call in the hyperlink, but the questions has to be asked, what are you trying to achieve?

Code: Select all

<a href="file:///c:/">c drive</a>

Posted: Thu Mar 03, 2005 8:16 am
by lauraSatellite
hey,
thanks for the input so far.

when the user (on a client machine) navigates to the site, a folder is meant to download to their c drive (having problems with this too). It is this folder that I want to create a link to. Basically its just to provide a link to the user to click, rather than going to "My Computer", "C:/", "Downloaded Folder".

I tried
<a href="C:/Folder">Click me</a>
and
<a href="file:///C:/Folder/">Click me</a>
as wayne suggested. Neither works when viewing the site from the client machine.

any other suggestions?

Posted: Thu Mar 03, 2005 8:57 am
by Chris Corbyn
Not everybody has a C drive. If I used Linux your code wouldn't work.

Posted: Thu Mar 03, 2005 9:30 am
by lauraSatellite
Good point. However the project is designed for microsoft machines; even so your point is still valid.

This asside, (as i can run checks on this before hand, and save to another present drive), would you see any way of linking to a clients c-drive from the server hosted php page?

Posted: Thu Mar 03, 2005 10:28 am
by Chris Corbyn
You can't connect the the client's filesystem on the server (not without a plugin or java applet that the user accepts the security warning for anyway). There's major security issues with that. PHP cannot do it.

Posted: Thu Mar 03, 2005 11:24 am
by lauraSatellite
hey, thanks for the reply.
If php cannot do this, do you know of a language that can?

Posted: Thu Mar 03, 2005 11:24 am
by lauraSatellite
or...maybe i should just avoid it...because of the security issues you mentioned...ill try a work-around...

Posted: Thu Mar 03, 2005 11:27 am
by Chris Corbyn
I belive a java applet will do it but that depends on the clients security levels and they'd also have to accept a security warning popup.

Well, antileech for downloading files that the host wants to protect from leechers has a java applet and that writes to the client machine so it is obviously possible...

Posted: Thu Mar 03, 2005 11:31 am
by feyd
I don't understand what all this is really for.. :?

Posted: Thu Mar 03, 2005 11:34 am
by Chris Corbyn
Me neither :? .... It's gonna be buggy even if it worked cos all it takes is for the client to rename/move or delete the folder/file and it all goes horribly wrong. But yeah... what on Earth do you need a webpage to do this for? 8O :?:

Posted: Thu Mar 03, 2005 12:13 pm
by lauraSatellite
Thanks for all the replies :)

I can do error checks to verify the required folder location.

The intention is for the user to download the files *each* time they visit the website (this happens in the onload).

This makes and archieve of information on the server the basis of the users archieve of information, which will grow continually.

what was said about the user changing the folder name, that would mess up the continuity of the archive, but it wouldnt stop the program from working (as a new hierarchy of information would be downloaded to take the place of the newly-renamed folder).

I hoped that PHP would have an ability to write from server to client. This is the first time ive used php, so im not exactly up-to-scratch on it. Should I take it that it will not write from server to client?