var conn = mongoose.createConnection(config.db);
conn.once('open', function (err) {
if (err) {
next(err);
return;
}
var source = fs.createReadStream(req.files.sample.path);
var gfs = Grid(conn.db, mongoose.mongo);
var id = mongoose.Types.ObjectId();
var target = gfs.createWriteStream({
_id: id,
filename: req.files.sample.name
});
source.pipe(target).on('close', function() {
project.documentation = id;
persistProject(req, res, next, project);
});
}
當我試圖把它上傳OS顯示下面的錯誤。 終止申請:undefined錯誤:ENOENT,打開「空/ 60c0f337f3413edbc5eb3bb27fa3269f」
events.js:72 throw er; //未處理的 '錯誤' 事件 ^ 錯誤:ENOENT,打開 '空/ 60c0f337f3413edbc5eb3bb27fa3269f'
爲什麼這個錯誤會來嗎?請幫我解決它。
http://stackoverflow.com/questions/9047094/node-js-error-enoent – therealrootuser 2014-09-23 04:41:04