I am running Apache on a Linux server, I have an application mounted there that needs to read a directory from the enduser computer to copy some files, the problem is that the users work with Windows, all the app works fine but when trying the opendir command form PHP i get: failed to open dir: No such file or directory
I tried parsing the Windows path like this: - Verbose: "C:\path\to\files to copy" - With linux slashes: "C:/path/to/files to copy" - With double backslashes: "C:\\path\\to\\files to copy" - All of the above without spaces: "C:/path/to/files%20to%20copy"
None of these worked so far, they all give me the same Warning and never read the directory contents.
I'm running PHP 7.3 on Ubuntu 14 server.
$src = "C:\\path\\to\\files";
$dir = opendir($src); //this fails
var_dump(opendir($src)); //this outputs: bool(false)
At the end I need to use a recursive function on PHP to copy the contents of the directory to the server and keep the structure intact, but if the script is not able to open the directory nothing I do will work after that. Any suggestions?