© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
2 replies
kevin122892

Deleting From Storage in Python

This is slightly strange as I know most people don't do supabase queries in python but lets assume file_path is 100% the name of the item in storage. why is this not deleting the file in that bucket?

def delete_media(media):
try:
file_path = media.split(MEDIA_PATH)[-1].split("?")[0]
logging.info(f"FILEPATH: {filepath}")

response = supabase.storage.from
(BUCKET_NAME).remove([file_path])

logging.info(f"DELETE MEDIA RESPONSE: {response}")
if not response:
logging.info(f"Successfully deleted the file from storage: {file_path}")
else:
logging.error("Error deleting media")
except Exception as e:
logging.error(f"Error deleting file: {str(e)}")


INFO:root:DELETE MEDIA RESPONSE: []
ERROR:root:Error deleting file: 'list' object has no attribute 'data'
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Deleting image in storage
SupabaseSSupabase / help-and-questions
4y ago
Python Storage
SupabaseSSupabase / help-and-questions
4y ago
Deleting files from storage via CRON
SupabaseSSupabase / help-and-questions
4y ago
Rate limit when deleting from storage in the UI
SupabaseSSupabase / help-and-questions
3mo ago