You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the console log only returns 0 or 100 when using the getPercentCompleted() command?
My Code:
let files = [{ sourceFileName: sourceFile, targetFileName: targetFile }];
let uc = new UploadFilesCommand(newClient, { files });
uc.execute();
while (uc.isFinished() !== true) {
await (async () => { return new Promise(resolve => setTimeout(resolve, 1000)) })();
console.log(uc.getPercentCompleted() + "%");
}
const uploadResult = uc.getResultMetaData();
if (uc.getStatus() === CommandStatus.success) {
console.log(uploadResult.messages);
console.log(uc.getBytesUploaded());
} else {
console.log(uploadResult.errors);
}
Here is my output: 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 100% [ '/video.mp4' ] 80275042
Or is this correct and it only returns IF the command UploadFilesCommand was completed? Sounds weird to me and is not really what I would expect. I would like to show the percentage of the file in progress.
The text was updated successfully, but these errors were encountered:
sushibear
changed the title
getPercentCompleted return only 0 and 100
getPercentCompleted returns only 0 and 100
Mar 11, 2021
Hey there...
I was just trying to async upload a larger video file following your example here:
https://github.com/hobigo/nextcloud-node-client/blob/master/docs/upload.md
But the console log only returns 0 or 100 when using the getPercentCompleted() command?
My Code:
Here is my output:
0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 0% 100% [ '/video.mp4' ] 80275042
Or is this correct and it only returns IF the command UploadFilesCommand was completed? Sounds weird to me and is not really what I would expect. I would like to show the percentage of the file in progress.
The text was updated successfully, but these errors were encountered: