SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can PHP do this?

    I'm wondering if PHP can read the location of a file off of a Local drive/directory, i.e. C:\temp\testfile.txt, put that location into a database field and then make the location a link when a query is run to list the files in that drive.

    How would I go about doing something like this?? I've tried connecting to a local drive but I'm not sure about the syntax.

    Thanks.

  2. #2
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A server side script cannot read a local drive. Thats impossible.
    THE INSTRUCTIONS BELOW ARE OLD AND MAY BE INACCURATE.
    THIS INSTALL METHOD IS NOT RECOMMENDED, IT MAY RUN
    OVER YOUR DOG. <-- MediaWiki installation guide

  3. #3
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if the server is part of the same local network? Or if the drive is located on the same server? Like my server is on the W: drive and I'm trying to access things on another drive.

    Are you saying that I can only access items that are under the root directory??

  4. #4
    SitePoint Enthusiast
    Join Date
    Dec 2003
    Location
    va
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check this:
    http://www.php.net/dir
    The table of Contents has all the functions you need to write that code.
    In the "user contributed notes" on that page, you can find a bunch of directory/file listing functions that will make your job a whole lot easier.
    Hope this helped.

  5. #5
    With More ! for your $ maxor's Avatar
    Join Date
    Feb 2004
    Location
    Scottsdale, Arizona
    Posts
    909
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Phil.Roberts
    A server side script cannot read a local drive. Thats impossible.
    I think he means local drive as in local to the computer running PHP.

  6. #6
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    Tulsa, OK
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yes Maxor, that is correct. thanks for clarifying.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •