get (remote) file path correctly