科多瓦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 }); },
- 在Visual Studio 2015 TACo上为Cordova插件集成获取构build错误
- 安装Cordova时出错
- 发送来自android的使用'离子运行android'到nodejs本地主机服务器的请求
- 我可以在Sqlite中查看我的表格devise和内容吗?
- npm install -g cordova,npm在Windows10上安装-g离子
- 在node-sass@0.9.6安装脚本“node build.js”失败
- cordova/离子应用程序通过服务器签名的url上传base64图像到S3
- Visual Studio iOS部署失败,因为“边缘模块尚未预编译”
- PhoneGap – 无法通过npm安装,phonegap不存在