I want to upload files to the Firebase cloud storage. I found that there are two different methods that I can use, which are StorageReference.putFile()
and StorageReference.putStream()
. I am confused on what is the difference between these two methods.
PS: I do not even know the difference between stream and file.
The difference is that these are overloded methods and are using different parameters. There are three flavours of putFile()
method:
- putFile(Uri uri, StorageMetadata metadata, Uri existingUploadUri)
- putFile(Uri uri, StorageMetadata metadata)
- putFile(Uri uri)
While putStream()
method has only two flavours:
- putStream(InputStream stream, StorageMetadata metadata)
- putStream(InputStream stream)
All these methods do the same, asynchronously uploads from a content URI to this StorageReference and all three return UploadTask .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.