Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ProgressBlock is not called on file upload #2151

Closed
JAGUAR108 opened this issue May 26, 2021 · 1 comment
Closed

ProgressBlock is not called on file upload #2151

JAGUAR108 opened this issue May 26, 2021 · 1 comment

Comments

@JAGUAR108
Copy link

ProgressBlock only displays progress 1.0 after the upload is complete

var task: Task {
		switch self {
...
case .uploadVideo(_, let url):
			let videoMultipart = MultipartFormData(provider: .file(url), name: "file")
			return .uploadMultipart([videoMultipart])
...

As I understand it, the delegate function should be called in alamofire to calculate the current progress:

func urlSession (_ session: URLSession,
                          task: URLSessionTask,
                          didSendBodyData bytesSent: Int64,
                          totalBytesSent: Int64,
                          totalBytesExpectedToSend: Int64)

I have set breakpoints in all places of the declaration of this function and it is not called.
With all that, the upload works well, and the file uploads successfully to the server, but I can't track the progress. Tried with files of different sizes, the result is the same: progressBlock is called once after loading with 1.0 progress.
Code request:

let request = provider.request(target, callbackQueue: nil) { progressResponse in
			print("progress = \(progressResponse.progress)")
		} completion: { ... }

output: progress = 1.0

@JAGUAR108
Copy link
Author

I found a problem, it was in the Wormholy library: pmusolino/Wormholy#77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant