How to access files in meteor. I have problems in getting the path work in windows local machine and also when I deploy to meteor.com.
My files are located in .uploads/template/ folder inside my meteor app
I tried to use process.env.PWD but this come as undefined in windows,
Then I decided to get the path with
var base = process.cwd();
console.log(“base path:”, base);
var afterresolvefind = base.split(‘.meteor’)[0];
var path = Meteor.npmRequire(‘path’);
var inputpath = “.uploads//templates//input.docx”
filepath = path.join(afterresolvefind, inputpath);
this works perfectly in windows local machine, but the folder organisation in meteor deployed in different.
If I use process.env.PWD it just gives “/” so I am not able to access the directory and the files in both places with same code.