www.webdeveloper.com
Results 1 to 4 of 4

Thread: I want to use URL path with glob() or scandir()

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Posts
    1

    I want to use URL path with glob() or scandir()

    Hello,

    What I have to do:
    1. Scan a directory and find a zip file
    2. unzip this file
    3. redirect the user to a specific file that has been unzipped previously (step 2.)

    I dont have problems when using absolute paths. But this I cannot do since I dont know whether this will be run in Windows or Linux..
    It would be easier if I could use glob with an URL:

    $zip_file = glob("http://".$_SERVER['SERVER_ADDR'].$directory."*.zip"); instead of
    $zip_file = glob("C:\my\actual\path\tozipfile\"*.zip")

    but it does not work!

    allow_url_fopen is enabled

  2. #2
    Join Date
    May 2003
    Posts
    599
    Your trying to scan a directory on another server?
    We do precision guesswork

  3. #3
    Join Date
    May 2003
    Posts
    599
    You should be able to use relative url paths locally and php will translate it for you if on windows. I dont have a windows server to test on, but I am pretty sure it would work this way on windows too.
    We do precision guesswork

  4. #4
    Join Date
    Mar 2009
    Posts
    452
    \ is used to escape special characters in a string use /

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles