You can only access the current file path relative to your host URL, you cannot access the folder path of this file.
This is not allowed in JavaScript due to security concerns. If it was allowed, malicious scripts can easily read the internal folder structures of your server, which is bad.
source share