0

I have a requirement that identifies the client's file location. For example, if I update a file to server from a pc and its' location as follows.

C:\TestFolder\test_file.txt

I want to catch file location from above file. That would be

C:\TestFolder\

So I googled that and found this.

It says that I could not get the client file location. If then someone can suggest me a way to achieve this.

Llama
  • 25,925
  • 5
  • 49
  • 68
NoughT
  • 639
  • 3
  • 17
  • 35
  • Unless you code your client (via JavaScript) to include that information somehow, I don't see how you could achieve that. I don't think even the JavaScript File object has the full path. IIRC it only has the name. The server has no business knowing the source path on the client, so it isn't sent. – Llama Nov 20 '17 at 07:31
  • Indeed, the [JavaScript File Object](https://developer.mozilla.org/en-US/docs/Web/API/File/name) doesn't include the full path either. See [here though](https://stackoverflow.com/questions/15201071/how-to-get-full-path-of-selected-file-on-change-of-input-type-file-using-jav). – Llama Nov 20 '17 at 07:33
  • You can only see on server side the data the client has sent. The data to send is totally under control of the client, only the processing is under control of the server. BTW Server != Master but Server == Servant and Client == Master ;o) – Sir Rufo Nov 20 '17 at 07:54
  • You cannot for security reasons. Browsers do not send the path (and you should should not have access to your users file system). –  Nov 20 '17 at 08:05

0 Answers0