Firebase同时上传多张图片

Firebase同时上传多张图片

本文介绍了使用Google Firebase同时上传多张图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Swift iOS项目中使用Google Firebase。我有我的应用程序的一部分,用户从他们的设备中选择多张照片进行上传。我正在尝试找到将他们一次选择的所有照片上传到Firebase存储的最佳做法。我知道如何上传一张照片。

I'm using Google Firebase in a Swift iOS project. I have a part of my app where the user selects more than 1 photo from their device to upload. I'm trying to find the best practice for uploading all the photos they selected at once to Firebase Storage. I know how to upload one photo.

我查看了文档但没有看到任何关于上传多个NSData对象的方法,所以我只是运行for循环和单独上传每张图片?

I looked through the Docs and didn't see any methods about uploading multiple NSData objects, so would I just run a for loop and upload each image individually?

谢谢!所有反馈都表示赞赏。

Thanks! All feedback is appreciated.

推荐答案

@FrankVanPuffellen在评论中的回答......

Answered by @FrankVanPuffellen in comments...

你的确只是循环并单独上传它们。如果你一次上传一个,你的iOS用户也会很感激,这样他们就可以在中途中止上传而不会丢失所有图像的进度。 - Frank van Puffelen

"You'd indeed just loop and upload them individually. Your iOS user might also appreciate if you upload them one at a time, so that they can abort the upload midways through without losing progress on all images." – Frank van Puffelen

这篇关于使用Google Firebase同时上传多张图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-05 23:13