[英]Upload an image from client to the NodeJS server and save it internaly on the server?
[英]Can not upload image from MAC or ubuntu from server in nodejs
我正在嘗試在nodejs中使用多方上傳圖像。 它在本地主機上工作正常,但從服務器上載時出現問題。 這是代碼
module.exports.uploadimg = function (req, res) {
var form = new multiparty.Form();
form.parse(req, function(err, fields, files) {
if(err) console.log(err) cloudinary.uploader.upload(files.file[0].path,function(result) {
res.send({ result:result,
serverStatus:200,
response_message:"image uploaded" });
});
});
}
當我從Windows上傳圖像時,它甚至可以正常工作,但是在通過MAC或Ubuntu上傳時顯示超時。
問題是由於某些ec2服務器設置。 我將代碼遷移到了Heroku服務器,並且在那里運行良好。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.