QuickBlox / quickblox-android-sdk

QuickBlox Android SDK includes code snippets with main use cases and framework JAR library.
BSD 3-Clause "New" or "Revised" License
417 stars 697 forks source link

How to cancel file upload #500

Closed Shahjahan786 closed 3 years ago

Shahjahan786 commented 6 years ago

How to cancel file upload : If a file is being uploaded and and due to its huge size or slow network it is taking more time to upload and user wants to cancel uploading..

RomanPronin commented 6 years ago

Sorry for long answer, did you try performer.cancel()? You can cancel API request after it has been started. For example: Performer<QBCustomObjectFileField> performer = QBCustomObjectsFiles.uploadFile(file, qbCustomObject, fieldName); performer.performAsync(new QBEntityCallback())...

performer.cancel();

Shahjahan786 commented 6 years ago

But I'm using QBContent.uploadFileTask method

RomanPronin commented 6 years ago

So, try the next: Performer<QBFile> performer = QBContent.uploadFileTask(file, true, null); performer.performAsync(new QBEntityCallback())... performer.cancel();

Shahjahan786 commented 6 years ago

Can I cancel file upload when progress is updated i.e. 50?

ghost commented 5 years ago

Whatup @Shahjahan786 Still relevant?

ghost commented 3 years ago

Hello QuickBlox customer,

This is Nikolay from QuickBlox support.

The issue was closed as it is outdated.

Please check the relevant section of our documentation here: https://docs.quickblox.com/docs/android-content

Also, please update the SDK to the latest version: https://github.com/QuickBlox/quickblox-android-sdk-releases/releases/tag/3.9.11

Additionally, please check our new samples: https://docs.quickblox.com/docs/code-samples#chat-samples

If it is still relevant after reviewing the updated information, feel free to open a new issue.

Have a nice day.