Skip to content

Instantly share code, notes, and snippets.

@andrzey
andrzey / gist:f20dba0485bd95f87ce07d654ce906aa
Created September 26, 2023 06:07
Upload progress axios
const onUploadProgress = event => {
const percentCompleted = Math.round((event.loaded * 100) / event.total);
console.log('onUploadProgress', percentCompleted);
};
const upload = async files => {
const data = new FormData();
for(const [index, file] of files.entries()){
data.append(index, file); // append all files