feat(storage): enhance save_file method to accept storage class parameter

This commit is contained in:
Siddhant Rai
2025-07-10 15:34:52 +05:30
parent 839a12bed4
commit 5623734276
3 changed files with 13 additions and 4 deletions

View File

@@ -168,7 +168,7 @@ def handle_image_upload(
filename = secure_filename(file.filename)
upload_path = f"{settings.UPLOAD_FOLDER.rstrip('/')}/{user}/{base_path.rstrip('/')}/{uuid.uuid4()}_{filename}"
try:
storage.save_file(file, upload_path)
storage.save_file(file, upload_path, storage_class="STANDARD")
image_url = upload_path
except Exception as e:
current_app.logger.error(f"Error uploading image: {e}")