hannibal Posted January 3, 2008 Share Posted January 3, 2008 I have tried to upload a file to an internal (different) network server from my webserver, using the mapped drive of Z:\. However, I keep getting the following error, no matter how many variences of code I use: Warning: mkdir() [function.mkdir]: No such file or directory in C:\www\domain\upload.php on line 49 CUSTOM MESSAGE:Cannot make DIR: Z:\ - ERROR CREATING:Z:\ However, if I change my file to C:\, the upload works like a charm. I have checked and the web user (system) has access to the mapped Z:\ drive which auto reconnects at login. I am using latest PHP and Apache. I have even tried using the IP address of the other server, but this just creates a folder in my www\domain folder, called 192.168.0.5\fileToBeUploaded. Many thanks, Jay Quote Link to comment https://forums.phpfreaks.com/topic/84214-copy-file-over-a-mapped-network-drive-using-php/ Share on other sites More sharing options...
hitman6003 Posted January 3, 2008 Share Posted January 3, 2008 mapped drives are user specific. The webserver, and consequentially php, run under a different username (IUSER_servername). Therefor, the mapped drives that you have, are not available to php. Use something like the following to access that server: copy('./source_file.txt', '\\255.255.255.255\c$\uploaded_files\source_file.txt'); Note the two backslashes before the server IP (or server name). I used c$, but you can use any shared folder. Quote Link to comment https://forums.phpfreaks.com/topic/84214-copy-file-over-a-mapped-network-drive-using-php/#findComment-428832 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.