1
我創建的資產/ XLS目錄中的.xls文件:sails.js:在資產目錄中下載文件
fs.writeFileSync('./assets/xls/data.xls', xls, 'binary');
我要下載此文件:
要獲取文件網址:
var downloadLink = req.headers.host+'/xls/data.xls';
我不understant爲什麼我對這個URL 404錯誤:
本地主機:1337/XLS/data.xls
該文件存在於./assets/xls/? – jaumard 2015-04-01 13:50:11
是文件存在 – 2015-04-01 13:51:15
對不起,它出現在您的項目文件夾或您的web部署文件夾下.tmp/public/xls /?因爲如果它只在你的項目文件夾下,那麼404 – jaumard 2015-04-01 13:55:54