Open laellou opened 6 years ago
Hi, I don't understand why my script is not called, I made some test and this file is not executed, everything is ok in the front, but my file is not uploaded
here is my code :
$scope.uploadFiles = function(file, errFiles) { $scope.f = file; $scope.errFile = errFiles && errFiles[0]; if (file) { file.upload = Upload.upload({ url: myurl, data: {file: file} });
file.upload.then(function (response) { $timeout(function () { file.result = response.data; }); }, function (response) { if (response.status > 0) $scope.errorMsg = response.status + ': ' + response.data; }, function (evt) { file.progress = Math.min(100, parseInt(100.0 * evt.loaded / evt.total)); }); } }
front:
<input type="file" ngf-select="uploadFiles($file, $invalidFiles)" accept="video/*" ngf-max-size="80MB"> Select File File:
</span>
Like in the example, Waht am I doing wrong ?
Thanks
Hi, I don't understand why my script is not called, I made some test and this file is not executed, everything is ok in the front, but my file is not uploaded
here is my code :
$scope.uploadFiles = function(file, errFiles) { $scope.f = file; $scope.errFile = errFiles && errFiles[0]; if (file) { file.upload = Upload.upload({ url: myurl, data: {file: file} });
front:
Upload on file select
<input type="file" ngf-select="uploadFiles($file, $invalidFiles)" accept="video/*" ngf-max-size="80MB"> Select File
File:
{{errorMsg}}
Like in the example, Waht am I doing wrong ?
Thanks