i’m got error
System.AggregateException: One or more errors occurred. —> Firebase.Storage.StorageException: Could not read file.
— End of inner exception stack trace —
—> (Inner Exception #0) Firebase.Storage.StorageException: Could not read file.<—
UnityEngine.Debug:Log(Object)
<>c__DisplayClass4_0:b__0(Task`1) (at Assets/Worker/Script/UnKnowError.cs:40)
System.Threading._ThreadPoolWaitCallback:PerformWaitCallback()
public class UnKnowError : MonoBehaviour
{
FirebaseStorage storage;
StorageReference storage_ref;
void Start()
{
storage = Firebase.Storage.FirebaseStorage.DefaultInstance;
storage_ref = storage.GetReferenceFromUrl("gs://sandworker-47e95.appspot.com");
}
// Update is called once per frame
void Update()
{
if (Input.GetKeyDown(KeyCode.B))
{
UploadPicture();
}
}
private void UploadPicture()
{
string local_file = "file:///C:/pic/TestPic.jpg";
// Create a reference to the file you want to upload
StorageReference rivers_ref = storage_ref.Child("TestPic.jpg");
// Upload the file to the path "images/rivers.jpg"
rivers_ref.PutFileAsync(local_file).ContinueWith((Task<StorageMetadata> task) => {
if (task.IsFaulted || task.IsCanceled)
{
Debug.Log(task.Exception.ToString());
// Uh-oh, an error occurred!
}
else
{
// Metadata contains file metadata such as size, content-type, and download URL.
StorageMetadata metadata = task.Result;
string DownLoad_Url = rivers_ref.GetDownloadUrlAsync().ToString();
Debug.Log(DownLoad_Url);
}
});
}
}
Oh!!!
please tell me What i’m worng???