PirateNinjaNala Posted March 5, 2007 Share Posted March 5, 2007 I want to write a program that will upload data from files into a database. The files are on a different server than the web server. This is what I am currently doing: $directory = "file://///zim/Bionutrition/Data" . " " . "Transfer/ESHA/"; $scandir = scandir($directory); This is the error message that I get. Warning: scandir(file://///zim/Bionutrition/Data Transfer/ESHA/) [function.scandir]: failed to open dir: No such file or directory in /home/web/gcrcstaff.crc.medctr.ohio-state.edu/bionutrition/data_mgt/ESHA/index.php on line 8 Warning: scandir() [function.scandir]: (errno 2): No such file or directory in /home/web/gcrcstaff.crc.medctr.ohio-state.edu/bionutrition/data_mgt/ESHA/index.php on line 8 I am absolutely sure that the path exists. I have copied and pasted that url into Firefox without a problem. I have tried accessing that directory by using the machine's IP address instead of its name, but I get an error that says "failed to open dir: not implemented". Quote Link to comment Share on other sites More sharing options...
jcbarr Posted March 5, 2007 Share Posted March 5, 2007 I'm no expert but it looks like you have way too many ///s in that file path. Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 5, 2007 Share Posted March 5, 2007 I'm no expert but it looks like you have way too many ///s in that file path. yeah, you only need to escape backslashes '\' not forward slashes. Quote Link to comment Share on other sites More sharing options...
PirateNinjaNala Posted March 5, 2007 Author Share Posted March 5, 2007 I'm no expert but it looks like you have way too many ///s in that file path. I've tried it without the extra slashes, but it still doesn't work. I've tried it with two and I've tried it with none. Quote Link to comment Share on other sites More sharing options...
PirateNinjaNala Posted March 5, 2007 Author Share Posted March 5, 2007 I tried this, but no luck. I really don't know what I'm doing wrong. $directory = "\\\zim\\Bionutrition\\Data" . " " . "Transfer\\ESHA\\"; Quote Link to comment Share on other sites More sharing options...
boo_lolly Posted March 5, 2007 Share Posted March 5, 2007 I'm no expert but it looks like you have way too many ///s in that file path. I've tried it without the extra slashes, but it still doesn't work. I've tried it with two and I've tried it with none. you have a space between your path and filename. what's that about? $directory = "file://///zim/Bionutrition/Data" . " " . "Transfer/ESHA/"; if you have a space in your directory name, try escaping the whitespace like this: file://zim/Bionutrition/Data\ Transfer/ESHA/"; or try this: $directory = "file://zim/Bionutrition/Data/Transfer/ESHA/"; or try this: $directory = "/zim/Bionutrition/Data/Transfer/ESHA/"; if you have a '/' at the very beginning of your path, this means that you are coming from the ROOT directory. is this where you want to start from? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.