科多瓦ios错误:ENOENT,打开'/var/mobile/Containers/Data/Application/../../image.jpg in heroku

我正在尝试从iPhone上传图像。 我正在使用cordova插件中的离子,并在后端使用express / node.js。 这段代码工作正常,当我尝试在本地。 但是当我运行在heroku我得到这个错误

错误:ENOENT,打开/var/mobile/Containers/Data/Application/../../image.jpg

我正在使用multer来处理多部分/表单数据

在expressjs / node.js端我有

router.post('/me/avatar', ensureAuthenticated, function(req, res) { fs.readFile(String(req.body.imageUrl).substring(7), function(err, data) { //using String(req.body.imageUrl).substring(7) to avoid file path like "file:///var/mobile/.." in ios simulator and iphone if (err) { console.log(err) res.send({ message: "Error" }) }; }); 

})

在离子方面我有

  $scope.updateAvatar = function() { var options = { maximumImagesCount: 1 }; $cordovaImagePicker.getPictures(options) .then(function(results) { $http.post(API_URL+"/users/me/avatar", { imageUrl: results[0] }) .success(function(response) { var random = (new Date()).toString(); $scope.avatar = response.fullPath + "?cb=" + random; }) }, function(error) { // error getting photos }); },