我在上传图片时发现了以下错误。
"showStack":false,"stack":"错误:错误:在完成时生成 EACCES\n (/var/www/projects/mywebsite/dist/node_modules/gulp-gm/index.js:40:21)\n 在gm. (/var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/node_modules/async/lib/async.js:485:30)\n 在 emitMany (events.js:127:13)\ n 在 gm.emit (events.js:201:7)\n
在通用汽车 (/var/www/projects/mywebsite/dist/node_modules/gm/lib/getters.js:70:16)\n 在 cb (/var/www/projects/mywebsite/dist/node_modules/gm/lib/command. js:322:16)\n 在 gm._spawn (/var/www/projects/mywebsite/dist/node_modules/gm/lib/command.js:226:14)\n 在 gm._exec (/var/www/ projects/mywebsite/dist/node_modules/gm/lib/command.js:190:17)\n 在 gm.proto.(匿名函数) [as size] (/var/www/projects/mywebsite/dist/node_modules/gm /lib/getters.js:68:12)\n 在 /var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/index.js:46:16\n 在 fn (/var/www/ projects/mywebsite/dist/node_modules/gulp-image-resize/node_modules/async/lib/async.js:582:34)\n 立即。(/var/www/projects/mywebsite/dist/node_modules/gulp-image-resize/node_modules/async/lib/async.js:498:34)\n 在runCallback (timers.js:574:
我已经将文件夹权限更改为,755
但仍然遇到错误。请帮助我如何解决该问题。
我ng-file-upload
用于文件上传。
客户端代码,
this.uploadLogo = function ($files, institute) {
var def = $q.defer();
var file = $files[0];
if (file.size < 5000000) {
$upload.upload({
url: 'api/logo',
method: 'POST',
file: file,
data: myformdata
}).success(function (resp) {
def.resolve(resp);
}).error(function (err) {
def.reject(err);
});
}
return def.promise;
};