Skip to content

Commit

Permalink
Merge pull request #1080 from nextcloud-libraries/fix/non-chunked-upl…
Browse files Browse the repository at this point in the history
…oad-progress
  • Loading branch information
skjnldsv authored Feb 4, 2024
2 parents b563ecf + 199a3ea commit 858193a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion lib/uploader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,10 @@ export class Uploader {
encodedDestinationFile,
blob,
upload.signal,
() => this.updateStats(),
(event) => {
upload.uploaded = upload.uploaded + event.bytes
this.updateStats()
},
undefined,
{
'X-OC-Mtime': file.lastModified / 1000,
Expand Down
4 changes: 2 additions & 2 deletions lib/utils/upload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { AxiosResponse } from 'axios'
import type { AxiosProgressEvent, AxiosResponse } from 'axios'
import { generateRemoteUrl } from '@nextcloud/router'
import { getCurrentUser } from '@nextcloud/auth'
import axios from '@nextcloud/axios'
Expand All @@ -22,7 +22,7 @@ export const uploadData = async function(
url: string,
uploadData: UploadData,
signal: AbortSignal,
onUploadProgress = () => {},
onUploadProgress:(event: AxiosProgressEvent) => void = () => {},
destinationFile: string | undefined = undefined,
headers: Record<string, string|number> = {},
): Promise<AxiosResponse> {
Expand Down

0 comments on commit 858193a

Please sign in to comment.