In this lecture, we are going to quickly update fire bases, storage rules to allow images.
I'm reviewing the rules for our storage rules before updating our rules.
Let's review them.
Fire Base is going to apply our rules to the entire file storage.
We're adding rules for reading, writing and deleting files from the storage.
All users are allowed to view files uploaded to our storage.
File uploads are restricted to three conditions.
Users must be logged in.
Files must be videos.
And lastly, files cannot exceed our maximum file size.
These rules are simple yet effective.
There's just one problem we're going to be uploading images.
Images will be rejected based on our current rules sets.
We should update our rules to allow images.
We're going to modify the second condition by wrapping it with a pair of parentheses.
Parentheses will group a pair of conditions.
I'm going to format my code to make it readable.
We're going to add to conditions inside the parentheses.
They'll both be similar to the second condition, we'll check if the request resource dot content type
property is equal to image PNG.
We're using the OR operator, either condition can be true.
Basically, we're checking if the file is an MP for or PNG image.
If either condition is true, the user will be allowed to upload a file.
Let's publish our changes.
After a few seconds, our rule should be live.
However, without changing our rules.
We may encounter unexpected errors in the council in the next set of lectures.
We're going to finalize the form by sending the file to Firebase.
I'll see you there.