-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Cancel upload and add Progress Callback befor internally save #807
Comments
Thanks for opening this issue!
|
Did you model this after other Parse SDKs, in case they support this feature yet? Because we want the method names, behavior and approaches to be similar as much as possible. |
for cancel upload and download, yes in Parse SDK Android and Parse SDK IOS Regarding the second case, if we don't request a callback first, we can't good manage the upload or download progress. |
Is it even possible that a file upload and download are in progress at the same time? Either a file needs to uploaded or downloaded. Maybe instead of separate The same for the Android SDK: ParseFile file = new ParseFile("resume.txt", data);
file.saveInBackground(new SaveCallback() {
public void done(ParseException e) {
// Handle success or failure here ...
}
}, new ProgressCallback() {
public void done(Integer percentDone) {
// Update your progress spinner here. percentDone will be between 0 and 100.
}
}); Apple SDK: PFFileObject *file = [PFFileObject fileObjectWithName:@"resume.txt" data:data];
[file saveInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
// Handle success or failure here ...
} progressBlock:^(int percentDone) {
// Update your progress spinner here. percentDone will be between 0 and 100.
}]; This way there is no ambiguity as the handler is part of the |
In the case of cancel, a function can be written ParseObject object=ParseObject("book");
ParseFile file=...;
file.addUploadProgressCallback((count, total) {
print("total=$total | count=$count");
});
object.img = file;
object.save(); |
Got it, then maybe we can simplify the name at least. Would it make sense to add it as a property, so it be set like this (pseudo code)?
|
changed ParseFile file=...;
file.progressCallback((count, total) {
print("total=$total | count=$count");
});
file.save(); and now it works for both download and upload |
Amazing! |
New Feature / Enhancement Checklist
Current Limitation
It is not possible to stop the upload.
It is also not possible to give Progress Callback file to Parse before internally saving
Feature / Enhancement Description
I suggest that this possibility exists because it is very important, especially to cancel the upload
Example Use Case
and
Alternatives / Workarounds
Currently, these tasks are not possible
The text was updated successfully, but these errors were encountered: