-
-
Notifications
You must be signed in to change notification settings - Fork 692
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
Multiple File Upload Notification #243
Comments
I'd love to see a PR with that feature! |
Hello, In the topic of Multiple File Upload Notifiation, I've been trying to reach a notification like this: Is this is possible with the current notification config or It can't be done? Thanks. |
yes, a multipart upload request with threee files |
Thanks so much for you answer, Can you tell me where to look about making 1 by 1 progress? And is this what you mean? Thanks. |
You can use placeholders in notification messages. https://github.com/gotev/android-upload-service/wiki/Recipes#notification-configuration |
And yes, you can add multiple files like that |
Hello, I tried it and its ok, but I find it difficult to track upload errors, Tried to get callbacks from server and then update the notification error, but it didn't work as I need it to. So I just added the whole request in the for loop and send 1 request for each image, this way I get single notification for each image for failed messages.. One other thing, in the Thank you for your great work ;) |
So, you need something a library doesn't support yet: multiple parallel multipart requests which has to be aggregated on a single notification, but with separate error handlers for each upload. To support that, a library redesign may be needed and your help is greatly appreciated. |
I'm not really sure what to call it. But here I'll try to simplify what I mean: -Send all photos in one request using I think i reached that but without the "one request" nor "error callbacks" part. Overall, it works fine, It just needed to be more accurate for the user to know the exact error and the file name so he can take the needed action. Thank you so much |
if you send all the images in a single request, you can't make 1 by 1 uploads, because all the files are added in the same request. That's how multipart works. Also, since the multipart request is not resumable, if at some point the upload fails, you have to start over from the beginning. To make 1 by 1 uploads you will have to make N Multipart requests and handle each one of them separately. If you want to have N multipart requests, but see their progress in a single notification with overall progress, it has to be implemented. Being said that, if you have a single multipart request, you can display the total number of files and the uploaded files with the following upload notification config: protected UploadNotificationConfig getNotificationConfig() {
return new UploadNotificationConfig()
.setInProgressMessage(Placeholders.UPLOADED_FILES + " of " +
Placeholders.TOTAL_FILES + ". Speed: " +
Placeholders.UPLOAD_RATE)
.setCompletedMessage("upload completed")
.setErrorMessage("error while uploading files")
.setCancelledMessage("upload aborted")
.setRingToneEnabled(true);
}
What do you mean by From my point of view, the better choice for more complex use cases is to use the broadcast receivers, either globally or inside an activity, depending on your use case. Both are documented here. You can have whatever checks you need in the |
I get what you mean, so lets forget about the What I mean by read from server callbacks is each request does send a callback in the |
@mostafaspace maybe #259 addresses exactly what you need |
Hello, Can you please help me..?
and i using com.android.support:support-v4:25.+ Thanks before. |
@azizarc88 open a new issue instead of posting here, thanks |
I am unable to upload multiple files due to lack of code example , Please provide complete code to upload multiple files, Correct me if i have missed anything , Thanks |
@zoptaltechnical This is the code example you are looking for: https://github.com/gotev/android-upload-service/wiki/Recipes#multipart . Just call |
@gotev Do you have plans for the
right now or would this be something open for community contributions? |
Unfortunately I don't have plans to do it myself due to lack of time, but contributions are always welcome, so feel free to make your own implementation and send a PR |
Closing this due to lack of contributions so far. Feel free to reopen it if you have a PR ;) |
@gotev is this something which is contained in / easier to solve in UploadService 4? |
@PhilLab Yes! It's out of the box 🎉 https://github.com/gotev/android-upload-service/wiki/Configuration#notification-handler |
@gotev This are very good news, thanks for the effort you put in 👍 We will start moving from version 3 to 4, I guess 😄 |
@PhilLab it's been a lot of work, but the library needed to be modernized from the ground up. Everything is new down below. It will be interesting if you documented the process and then we can include it in the Wiki (or a Medium/Blog article if you prefer) as a concrete real world migration example. Bear in Mind 4.x has minAPI 21 and other breaking changes but it's definitely worth it from every point of view when compared to 3.x. New Wiki has many guides already. If you miss something, open an issue ;) |
Hey,
is there a way to show a notification, which is handling the total progress for multiple file upload (using multiple requests) out of the box?
Best regards
The text was updated successfully, but these errors were encountered: