1 00:00:00,330 --> 00:00:06,210 In this lecture, we are going to quickly update fire bases, storage rules to allow images. 2 00:00:06,480 --> 00:00:11,040 I'm reviewing the rules for our storage rules before updating our rules. 3 00:00:11,130 --> 00:00:12,120 Let's review them. 4 00:00:12,480 --> 00:00:17,010 Fire Base is going to apply our rules to the entire file storage. 5 00:00:17,310 --> 00:00:22,020 We're adding rules for reading, writing and deleting files from the storage. 6 00:00:22,440 --> 00:00:26,430 All users are allowed to view files uploaded to our storage. 7 00:00:26,700 --> 00:00:29,820 File uploads are restricted to three conditions. 8 00:00:30,060 --> 00:00:31,770 Users must be logged in. 9 00:00:31,950 --> 00:00:33,720 Files must be videos. 10 00:00:33,840 --> 00:00:38,250 And lastly, files cannot exceed our maximum file size. 11 00:00:38,550 --> 00:00:40,980 These rules are simple yet effective. 12 00:00:41,250 --> 00:00:45,030 There's just one problem we're going to be uploading images. 13 00:00:45,270 --> 00:00:48,720 Images will be rejected based on our current rules sets. 14 00:00:49,170 --> 00:00:52,110 We should update our rules to allow images. 15 00:00:52,260 --> 00:00:57,390 We're going to modify the second condition by wrapping it with a pair of parentheses. 16 00:00:59,840 --> 00:01:02,850 Parentheses will group a pair of conditions. 17 00:01:03,140 --> 00:01:06,170 I'm going to format my code to make it readable. 18 00:01:08,600 --> 00:01:12,260 We're going to add to conditions inside the parentheses. 19 00:01:12,500 --> 00:01:19,640 They'll both be similar to the second condition, we'll check if the request resource dot content type 20 00:01:19,640 --> 00:01:22,870 property is equal to image PNG. 21 00:01:25,930 --> 00:01:29,830 We're using the OR operator, either condition can be true. 22 00:01:30,130 --> 00:01:35,170 Basically, we're checking if the file is an MP for or PNG image. 23 00:01:35,440 --> 00:01:39,970 If either condition is true, the user will be allowed to upload a file. 24 00:01:40,180 --> 00:01:41,950 Let's publish our changes. 25 00:01:44,430 --> 00:01:47,670 After a few seconds, our rule should be live. 26 00:01:47,910 --> 00:01:50,430 However, without changing our rules. 27 00:01:50,580 --> 00:01:56,040 We may encounter unexpected errors in the council in the next set of lectures. 28 00:01:56,220 --> 00:02:00,210 We're going to finalize the form by sending the file to Firebase. 29 00:02:00,480 --> 00:02:01,530 I'll see you there.