Skip to content

amplify_flutter: Does not support content type. It only create user defined metadata #6405

@T-Ville

Description

@T-Ville

When uploading via amplify it only upload the file with content type application/octet-stream.
If you define the meta data it will only create the following instead of overriding the actual Content-Type

Content-Type: application/octet-stream ❌ (default)
x-amz-meta-contenttype: image/jpeg ✅ (custom metadata) - This should be change to Content-Type and not as user define metadata

sample code
final contentType = lookupMimeType(filename) ?? 'application/octet-stream'; final options = StorageUploadFileOptions( metadata: {'Content-Type': contentType}, ); final result = await Amplify.Storage.uploadFile( localFile: AWSFile.fromData( await file.readAsBytes(), contentType: contentType, ), path: StoragePath.fromString('yourdirectory/$filename'), options: options );

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestA request for a new feature or an enhancement to an existing API or category.storageIssues related to the Storage Category

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions