Angularjs 无法使用angular js发布视频文件
我得到了Angularjs 无法使用angular js发布视频文件,angularjs,Angularjs,我得到了success=true但我的文件路径错误。我正在捕获视频,然后将该视频的位置路径交给我的post呼叫,以便将视频上传到服务器上。在POSTMAN请求中,它提交视频并给出响应success=true路径:app/uploads/jobs/12_524.mp4但是在app中,我只得到了路径,没有扩展名.mp4 这是电话 $rootScope.uploadQuestion = function (file) { //file is complete path of fi
success=true
但我的文件路径错误。我正在捕获视频,然后将该视频的位置路径交给我的post呼叫,以便将视频上传到服务器上。在POSTMAN
请求中,它提交视频并给出响应success=true
路径:app/uploads/jobs/12_524.mp4但是在app中,我只得到了路径,没有扩展名.mp4
这是电话
$rootScope.uploadQuestion = function (file) {
//file is complete path of file in device = localURL: "cdvfile://localhost/sdcard/DCIM/Camera/20170801_142942.mp4"
var form = new FormData();
form.append("job_id", "4124");
form.append("question_id", "11");
form.append("user_id", "159931");
form.append("file", file);
console.log('File: ' + file);
// prints this: File: cdvfile://localhost/sdcard/DCIM/Camera/20170801_142942.mp4
return $http({
method: 'POST',
headers: { 'Content-Type': undefined },
url: 'http://services.someservice.com/upload.php',
//transformRequest: angular.identity,
cache: false,
timeout: 300000
}).then(function (response) {
var data = response.data;
var status = response.status;
if (status == '200') {
if (data.success == "true") {
alert('uploading...');
}
}
}).catch(function (response) {
throw response;
});
}