How to check if a file exists in Firebase Storage from Unity?

490 views
Skip to first unread message

JOYSON S T

unread,
Aug 31, 2021, 10:32:37 AM8/31/21
to Firebase Google Group

I have tried several different ways to check if a file exists in the firebase Storage. But this one shows the debug text

if (storage.GetReferenceFromUrl($"gs://xxxxx-xxxxx-342352503.appspot.com/{fUser.UserId}") == null)
     Debug.Log("File Not Exist");
else
     Debug.Log("File Exists");

which shows the file Exists. And then, I deleted the file and checked once again. but it still shows the File Exists.

Can someone help me to solve this problem? Thank You.

JOYSON S T

unread,
Oct 28, 2021, 10:51:22 AM10/28/21
to fireba...@googlegroups.com
                    await storageRef.Root.Child(fUser.UserId).Child("FILE TO CHECK").GetDownloadUrlAsync().ContinueWith(async task2 =>
                    {
                        if (task2.IsFaulted || task2.IsCanceled)
                        {

                            Debug.Log("<color=Red>File Not Exists</color>");
                        }
                        else
                        {
                            Debug.Log("<color=green>File Exists</color>");
                        }
                    });

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b07e6ecb-e568-457c-8132-695051a9af52n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages