Is there anyone that can help me on how to put a progress bar while I'm uploading a file to indicate the user that the file is still uploading?. Sorry I'm still new regarding this one. I read a lot regarding this and still make me confuse on it. Thank you in advance!
Here is my html where I will submit the file:
<form class="form-group" ng-submit="addX()">
<div class="col-lg-4">
<input id="file" type="file" name="file" class="file btn btn-default" data-show-preview="false"><br>
<input id="submit" class="btn btn-primary" type="submit" name="submit" value="Upload" /><br/><br/>
</div>
</form>
And here is my js that will connect me to my python file:
$scope.addX = function() {
var f = document.getElementById('file').files[0]; console.log(f);
var formData = new FormData();
formData.append('file', f); console.log(formData);
$http({method: 'POST', url: 'http://x.x.x./',
data: formData,
headers: {'Content-Type': undefined},
transformRequest: angular.identity})
.success(function(data, status, headers, config) {
if (data.success) {
console.log('import success!');
}
})
.error(function(data, status, headers, config) {
});
// }
};