daviscup
06/13/2022, 3:12 AMpublicfiles
using this function:
const downloadFile = async (pathToFile) => {
const { data, error } = await supabase
.storage
.from('publicfiles')
.download(pathToFile)
if (error) throw error
return data
}
I logged out pathToFile
and the Url seems to be correct since I can view the image in my browser.
The error I'm getting is:
Uncaught (in promise)
{message: 'Access Denied', status: 400}
message: "Access Denied"
status: 400
[[Prototype]]: Object
My bucket is public and I'm using the standard Enable read access for all users
SELECT
policy for storage.objects. (public bucket itself has no policies)
Is there anything else I need to do?Needle
06/13/2022, 3:12 AMgaryaustin
06/13/2022, 4:00 AMdaviscup
06/13/2022, 4:49 AMconst { publicURL, error } = supabase.storage
.from('correctionfiles')
.pathToFile(filePath)
I can't find pathToFile
anywhere in the documentation. Do I need to use from.createSignedUrl()
in this case?daviscup
06/13/2022, 4:54 AMgaryaustin
06/13/2022, 3:29 PMNeedle
06/15/2022, 7:38 AM