jar
05/28/2022, 11:17 PMgaryaustin
05/28/2022, 11:30 PMjar
05/29/2022, 3:38 AM((bucket_id = 'posts'::text) AND (storage.extension(name) = 'webp'::text))
but I can simply name the file test.webp and provide a jpg image like this but I want the actual file type not just name extensionjar
05/29/2022, 10:34 AMmetadata:
cacheControl: "max-age=3600"
mimetype: "image/webp"
size: 279338
perhaps somehow getting mimetype and size would beuseful to limit as wellgaryaustin
05/29/2022, 1:55 PMjar
05/29/2022, 7:31 PM(
(bucket_id = 'posts'::text) AND
(
('private'::text = (storage.foldername(name))[1]) OR
('public'::text = (storage.foldername(name))[1])
) AND
((uid())::text = (storage.foldername(name))[2]) AND
(
(
(storage.extension(name) = 'webp'::text) AND
(json_extract_path(storage.metadata, '{mimetype}') = 'image/webp'::text) AND
(json_extract_path(storage.metadata, '{size}') < 999999 )
) OR
(storage.extension(name) = 'mp4'::text) OR
(storage.extension(name) = 'pdf'::text) OR
(storage.extension(name) = 'gif'::text)
)
)(
(bucket_id = 'posts'::text) AND
(
('private'::text = (storage.foldername(name))[1]) OR
('public'::text = (storage.foldername(name))[1])
) AND
((uid())::text = (storage.foldername(name))[2]) AND
(
(
(storage.extension(name) = 'webp'::text) AND
(jsonb_extract_path(storage.metadata, '{mimetype}') = 'image/webp'::text) AND
(jsonb_extract_path(storage.metadata, '{size}') < 999999 )
) OR
(storage.extension(name) = 'mp4'::text) OR
(storage.extension(name) = 'pdf'::text) OR
(storage.extension(name) = 'gif'::text)
)
)
and get error on save Error updating policy: missing FROM-clause entry for table "storage"Error updating policy: missing FROM-clause entry for table "storage"
can I access the metadata like that or is this saying I need some sort of like from(storage) functionjar
05/29/2022, 7:32 PMgaryaustin
05/29/2022, 7:37 PMjar
05/29/2022, 7:37 PM(json_extract_path(storage.metadata, '{mimetype}') = 'image/webp'::text)
jar
05/29/2022, 7:37 PMjar
05/29/2022, 7:39 PMgaryaustin
05/29/2022, 7:40 PMjar
05/29/2022, 7:43 PMgaryaustin
05/29/2022, 7:43 PMgaryaustin
05/29/2022, 7:45 PMjar
05/29/2022, 7:46 PMgaryaustin
05/29/2022, 7:48 PMgaryaustin
05/29/2022, 7:49 PMjar
05/29/2022, 7:55 PMsupabase
.storage
.from('posts')
.list('public/'+user.id, {
limit: 100,
offset: 0,
sortBy: { column: 'name', order: 'asc' },
}),
gets me the list of files and then i need urls from existing items
publicData.map(async (publicFile) => {
const { publicURL, error } = await supabase
.storage
.from('posts')
.getPublicUrl(`${user.id}/${publicFile.name}`, 60)
And it gives me urls but they dont work https://cnxmxunyrouuwprrtvst.supabase.co/storage/v1/object/public/posts/e8527e42-34de-4840-a378-c35f93a10570/test1.webpgaryaustin
05/29/2022, 7:58 PMgaryaustin
05/29/2022, 8:04 PMjar
05/29/2022, 8:08 PMgaryaustin
05/29/2022, 8:09 PMjar
05/29/2022, 10:01 PMjar
05/29/2022, 11:24 PMgaryaustin
05/29/2022, 11:46 PM