'Firebase storage requires twice during upload
I found that storage requires twice during uploading a single file
Like this:
Uploading : 0 out of 19160
Uploading : 19160 out of 19160
Uploading : 19160 out of 19160
May I ask is it possible to request once during upload?
Because it charges by request times.
I am worried abot this. Thanks.
Download just requests once, that is fine.
Best wishes
Code is similar with:
StorageReference _storageRef = FirebaseStorage.DefaultInstance.RootReference;
StorageReference _saveDataRef = _storageRef.Child("data");
string localFile = "...";
public void UploadFromFile()
{
_saveDataRef.PutFileAsync(localFile)
.ContinueWith((Task<StorageMetadata> task) =>
{
if (task.IsFaulted || task.IsCanceled)
{
Debug.Log(task.Exception.ToString());
}
else
{
StorageMetadata metadata = task.Result;
string md5Hash = metadata.Md5Hash;
Debug.Log("Finished uploading...");
Debug.Log("md5 hash = " + md5Hash);
}
});
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|