How to link to clients C drive?

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

lauraSatellite
Forum Newbie
Posts: 6
Joined: Wed Mar 02, 2005 4:26 am

How to link to clients C drive?

Post 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
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post 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.
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

and I would only like to delete a few files and your system goes KABOOOOM!!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

you can link to their hard drive just fine.. the server can't access it however.

file:///c:/ anyone? ;)
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post 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>
lauraSatellite
Forum Newbie
Posts: 6
Joined: Wed Mar 02, 2005 4:26 am

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Not everybody has a C drive. If I used Linux your code wouldn't work.
lauraSatellite
Forum Newbie
Posts: 6
Joined: Wed Mar 02, 2005 4:26 am

Post 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?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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.
lauraSatellite
Forum Newbie
Posts: 6
Joined: Wed Mar 02, 2005 4:26 am

Post by lauraSatellite »

hey, thanks for the reply.
If php cannot do this, do you know of a language that can?
lauraSatellite
Forum Newbie
Posts: 6
Joined: Wed Mar 02, 2005 4:26 am

Post by lauraSatellite »

or...maybe i should just avoid it...because of the security issues you mentioned...ill try a work-around...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I don't understand what all this is really for.. :?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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 :?:
lauraSatellite
Forum Newbie
Posts: 6
Joined: Wed Mar 02, 2005 4:26 am

Post 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?
Post Reply