I’m using the netanelgilad:excel package to import xls files into Mongo. I have a spreadsheet located in /private/datafiles/default_list.xls. I can’t seem to be able to access this file.
Server side:
var fileName = 'datafiles/default_list.xls';
var excel = new Excel('xlsx');
var fs = Npm.require('fs');
var path = Npm.require('path');
var basepath = path.resolve('.').split('.meteor')[0];
var workbook = excel.readFile(fileName);
results in error:
Exception while invoking method 'adminSLLoad' Error: ENOENT, no such file or directory 'datafiles/default_list.xls'
I’ve also tried:
var workbook = excel.readFile(basepath + fileName);
which gives me the right absolute path to the file, but still gives the error.
ENOENT, no such file or directory '/Users/brad/Workspaces/listory.proto/datafiles/default_list.xls'
Help! Thanks!