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". Link to comment https://forums.phpfreaks.com/topic/41338-failed-to-open-dir-no-such-file-or-directory/ 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. Link to comment https://forums.phpfreaks.com/topic/41338-failed-to-open-dir-no-such-file-or-directory/#findComment-200316 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. Link to comment https://forums.phpfreaks.com/topic/41338-failed-to-open-dir-no-such-file-or-directory/#findComment-200338 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. Link to comment https://forums.phpfreaks.com/topic/41338-failed-to-open-dir-no-such-file-or-directory/#findComment-200353 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\\"; Link to comment https://forums.phpfreaks.com/topic/41338-failed-to-open-dir-no-such-file-or-directory/#findComment-200373 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? Link to comment https://forums.phpfreaks.com/topic/41338-failed-to-open-dir-no-such-file-or-directory/#findComment-200375 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.