1

I have a window drive mounted as

\\192.168.0.168\

It is mounted as Z drive

There this file in folder DOC,MYFOLDER,FILE1.PDF that I wanna readfile() or copy out through php (I will use it to copy other file also)

However I also tried stuffs like

$file_path = "\\192.168.0.168\DOC\MYFOLDER\FILE1.pdf";
$filesize = ($file_path); 

echo "FILE SIZE IS $filesize";

it return no value, just FILE SIZE IS

How do I access my Z drive or the 192.168.0.168\DOC\MYFOLDER\FILE1.pdf as I wanna share this Network drive file to my IIS Web Server so user can download the PDF through my web server.

Thanks!

Manga Black
  • 197
  • 2
  • 9

1 Answers1

1

The backslash \ is the escape character, it needs to be escaped:

$file_path = "\\\\192.168.0.168\\DOC\\MYFOLDER\\FILE1.pdf";

Please note that PHP does not support Windows network authentication. You may be able to hack your way through, but I would rather mount the network location as a network drive.

Community
  • 1
  • 1
RandomSeed
  • 29,301
  • 6
  • 52
  • 87
  • 1
    @RandomSeedI am having the same problem, I mounted my drive as Z, but it was not working I tried like Z:, Z:/, Z:\\, nothing is working, I checked the permission, I have only full control on that drive, not the system account or any other account – Sam Jul 25 '18 at 07:04