By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,409 Members | 1,604 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,409 IT Pros & Developers. It's quick & easy.

how to Include a file from the user's c: drive

P: n/a
Hello all,
I am wondering what the best way to:
Include a file (html and/or text) into my
php application, that is not on the webserver, is.
For example, when the user visits the intranet site, if they
have a particular file on their c: drive, I want
to include it (without them having to upload it to the server)
on the page they are viewing...
Tight security is not of paramount concern.

thanks in advance!

best regards,
John

Jul 17 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
john wrote:
Hello all,
I am wondering what the best way to:
Include a file (html and/or text) into my
php application, that is not on the webserver, is.
For example, when the user visits the intranet site, if they
have a particular file on their c: drive, I want
to include it (without them having to upload it to the server)
on the page they are viewing...


Not possible unless they specifically upload it.

--
Oli

Jul 17 '05 #2

P: n/a
thanks, I did not think so...

Jul 17 '05 #3

P: n/a
NC
john wrote:

I am wondering what the best way to:
Include a file (html and/or text) into my
php application, that is not on the webserver, is.


First of all, using include on text/html files is
unnecessary. readfile() would work faster because it
would not look for PHP code to parse and execute.

Now to the actual question. In order to be included,
the file must be available to the Web server.
Theoretically, if all your machines (including the one
PHP runs on) are working under Windows, you can share
the directory where the target file is located and access
it like this:

readfile('\\ClientMachine\SharedDirectory\file.txt ');

Although, to be honest, I have no idea why something
like this may be necessary...

Cheers,
NC

Jul 17 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.