Stacktrace:
File "C:\Users\kanwa\AppData\Roaming\Python\Python313\site-packages\storage3_sync\file_api.py", line 51, in _request raise StorageException({**resp, "statusCode": response.status_code}) storage3.utils.StorageException: {'statusCode': 400, 'error': 'Bucket not found', 'message': 'Bucket not found'}
I get the error above running this script:
def upload_resume_to_applicant_record(resume_file, opening_id, applicant_mobile_number):
supabase.storage.from_('applicant-resumes').upload(
file=resume_file.read(),
path=f"{opening_id}/{applicant_mobile_number}",
file_options={"cache-control": "3600", "upsert": "false"},
)
The bucket I have created, "applicant-resumes" is a public bucket, with "INSERT" policies to allow insertion by anyone.
I want to send files from the backend to the bucket for storage, I have looked up the docs for Python and Supabase and haven't found any relevant answer, I have set up the SUPABSAE_URL AND SUPABSAE_KEYS and can perform other actions such as reading from the tables.
Please let me know how can I fix the error here and send the files to my database from the python script.
just create this policy that allows to access buckets to all authenticated users
CREATE POLICY "Allow authenticated users to view bucket" ON storage.buckets FOR SELECT TO authenticated USING (true);