2 Replies - 395 Views - Last Post: 15 May 2013 - 03:04 PM Rate Topic: -----

#1 Hello_World  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-May 13

How to read text file located at map networkdrive (Z:)

Posted 15 May 2013 - 01:51 AM

// How to read text file located at map networkdrive (Z:)

$myfile = "\\\\hostname\\reports\\service\\open.txt";

if(file_exists($myfile))
{
echo "!!GOTCHA!!";

}
else
{
	echo "Cant find location!! ( $myfile )";

}


Is This A Good Question/Topic? 0
  • +

Replies To: How to read text file located at map networkdrive (Z:)

#2 creativecoding  Icon User is offline

  • Hash != Encryption
  • member icon


Reputation: 926
  • View blog
  • Posts: 3,205
  • Joined: 19-January 10

Re: How to read text file located at map networkdrive (Z:)

Posted 15 May 2013 - 06:54 AM

Just enter the absolute path

Z:\\directory\\directory\\your_file.txt

Was This Post Helpful? 0
  • +
  • -

#3 AdaHacker  Icon User is offline

  • Resident Curmudgeon

Reputation: 452
  • View blog
  • Posts: 811
  • Joined: 17-June 08

Re: How to read text file located at map networkdrive (Z:)

Posted 15 May 2013 - 03:04 PM

There's no trick to it. In fact, using UNC paths like you have in your example should "just work".

If it doesn't, the problem is most likely with permissions. Keep in mind that the web server does not run under your user account - it has its own account with completely different permissions. You need to make sure that the account used by the web server has the proper permissions for the network share you're trying to access.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1