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

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • john

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

    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

  • Oli Filth

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

    john wrote:[color=blue]
    > 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...[/color]

    Not possible unless they specifically upload it.

    --
    Oli

    Comment

    • john

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

      thanks, I did not think so...

      Comment

      • NC

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

        john wrote:[color=blue]
        >
        > 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.[/color]

        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('\\Cli entMachine\Shar edDirectory\fil e.txt');

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

        Cheers,
        NC

        Comment

        Working...