Loading animation while uploading files
See original GitHub issueI was able to upload mutiple file from surveyjs using XHR upload from the sample. I can also see the total bytes uploaded . Is there any way to show them as the progressbar?
onUploadFiles = (result, options) => {
const totalCount = options.files.length;
options.files.map((file, i) => {
const formData = new FormData();
// options.files.forEach(file => {
formData.append('file', file);
$.ajax({
url: UploadURL,
type: 'POST',
xhr() {
const myXhr = $.ajaxSettings.xhr();
if (myXhr.upload) {
myXhr.upload.addEventListener(
'progress',
event => {
let percent = 0;
const position = event.loaded || event.position;
const total = event.total;
percent = (position / total) * 100;
console.log('percent', percent);
console.log('count', `${i}of${totalCount}`);
},
false,
);
}
return myXhr;
},
success(data) {
options.callback(
'success',
// multiple file fix
[file].map(file => {
return {
file,
content: data.secure_url,
};
}),
);
},
error(error) {
},
async: true,
data: formData,
cache: false,
contentType: false,
processData: false,
timeout: 60000,
});
});
};
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
php - How to include loading gif while file upload and insert to ...
To show the loading image when you are uploading, call the showLoading() function jus before the ajax call, and then hide it when...
Read more >Upload File with Vanilla JavaScript and Loading Animation
In this guide - learn how to upload files in a drop area with HTML, CSS, Vanilla JavaScript, and with a loading animation...
Read more >CSS Loading Animations: How to Make Them + 15 Examples
Learn how to create a loading animation with CSS that will keep visitors engaged while content loads on your site.
Read more >Loading animation while uploading files - Jotform
I'm using file uploads and there's really no blatant messaging to tell users that the files are being uploaded. Ideally, (in my mind)...
Read more >Upload Progress & Loading Animation React Native - YouTube
Now in this video we will see how we can create an upload progress while uploading image to our node js backend from...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@pankajQW @andrewtelnov Thanks for pointing out that bug. Finally I was able to do it for mutiple fileupload as well . Please correct me if anything is wrong
I did something like below , to show progress underneath file uploader