Enhancement: Add Content-Type metadata to S3/GCP uploads#223
Open
hamchowderr wants to merge 1 commit into
Open
Enhancement: Add Content-Type metadata to S3/GCP uploads#223hamchowderr wants to merge 1 commit into
hamchowderr wants to merge 1 commit into
Conversation
Fixes user-facing issue where uploaded files couldn't be previewed in browsers due to missing Content-Type headers. Internal changes: - Add get_content_type() function to detect MIME types from file extensions - Set ContentType in boto3 upload_fileobj() and create_multipart_upload() - Set content_type for GCP blob uploads - Uses Python's mimetypes module with fallback to application/octet-stream External impact: - Videos, audio, images now preview inline in browsers instead of forcing download - Browsers can properly identify and handle media file types - Improves user experience for media file access Modified files: - services/file_management.py (new get_content_type function) - services/s3_toolkit.py (ContentType in ExtraArgs) - services/gcp_toolkit.py (blob.content_type assignment) - services/v1/s3/upload.py (ContentType in multipart upload)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes user-facing issue where uploaded files couldn't be previewed in browsers due to missing Content-Type headers.
Internal changes:
External impact:
Modified files: