var path = require("path"); var absolutePath = path.resolve("Relative file path");
The dir structure, for example:
C: → WebServer-> Public-> Uploads-> MyFile.csv
and your working directory will be public, for example, path.resolve will be like that.
path.resolve("./Uploads/MyFile.csv");
POSIX home / WebServer / Public / Uploads / MyFile.csv
WINDOWS C: \ WebServer \ Public \ Uploads \ MyFile.csv
This solution is multi-platform and allows your application to work both on windows and on positioning machines.
source share