I want to use URL path with glob() or scandir()
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
Your trying to scan a directory on another server?
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.
\ is used to escape special characters in a string use /
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)