0

I need to read a text file in php. But file will vary based on users that which system they are using.

For example user1 access: i want to read a text file from their desktop location like

url : "C://Users/user1/desktop/data.txt",

user2 access: i want to read a text file from their desktop location like

url : "C://Users/user2/desktop/data.txt",

so i want to get the current machine desktop path as C://Users/{username}/desktop by using Javascript/PHP?

KMS
  • 566
  • 4
  • 16

1 Answers1

0

PHP is a server side language therefore it cannot read stuff on another computer. I have actually attempted this before in JavaScript and figured that it is not possible to read a file in any way unless the file is uploaded to the website server.

Sorry but what you are trying to do is not possible probably for security reasons and the fact that websites are meant to run in your browser and not on your computer.

Ahm23
  • 338
  • 3
  • 16