我有:
fs.readFile('../services/Prescipcion.xml', "utf8", function (err, data) {
console.log("err->", err);
console.log("data", data);
});
Run Code Online (Sandbox Code Playgroud)
并记录:
err-> {
[Error: ENOENT: no such file or directory, open '../services/Prescipcion.xml']
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '../services/Prescipcion.xml'
}
Run Code Online (Sandbox Code Playgroud)
我不明白为什么会这样.
我有这个上传照片:
module.exports = function (req, image, url, callback) {
var filename = (Math.floor((Math.random() * 100000000000) + 1)) + ".png";
req.file(image).upload({
dirname: '../../assets/images' + url
,
saveAs: function(file, cb) {
cb(null, filename);
}
}, function(error, uploadedFiles) {
return callback(null, "http://" + req.headers.host + "/images" + url + filename)
});
Run Code Online (Sandbox Code Playgroud)
}
它返回一个这样的URL:http:// localhost:1349/images/dependent/photos/30363010266.png
我可以看到我的照片上传到项目文件夹中,因为我看到它是物理的.但URL不起作用,似乎没有发现错误.
如果我重新启动服务器,URL工作正常.
谢谢!
我有这个变量:Física在mongoDB中,我有一个属性name为的模型Educación Física.
我会做的正则表达式传递变量Física不还给我Educación Física,但如果这个数据库的名字是一个模型fisica或FisiCa什么的,我还给YES.
我使用nodeJS,mongoDB,Javascript...
对不起我的英语,非常感谢你.