-
Notifications
You must be signed in to change notification settings - Fork 377
Being able to set 'content-type' to a resource before uploading to an S3 bucket #262
Comments
This would be super handy. All of the objects I've been uploading have the content-type application/octet-stream which isn't great |
From digging into the aws java sdk it would appear that for a simple put object request it will actually set the correct content-type metadata on the object for you. I've seen this behaviour using it from spring-cloud-aws too. However, the multipart upload api doesn't do this behaviour and I've raised an issue to discuss adding this aws/aws-sdk-java#1648. I think it would still be nice to set the content-type on the SimpleStorageResource and not rely on the aws s3 sdk to do this. I would be happy to contribute for this change, if one of the main contributors could point me in the right direction. One possible, albeit a bit ugly, solution to this would be to have a |
This would be useful for me too and, in fact, I would be happy to have a shot at implementing it but I dont think the So, what about modifying
and
i.e. infer the content-type from the file extension of the resource. This has the advantages that it requires no changes to the "API". Works in a way often used by other web and file-based resources and, in fact, how AWS SDK's putObject works when you give it a The downside here is that the object name (and therefore s3 key) would also include a file extension. We could also modify |
…aws#706) Sets content type to files uploaded to S3. Fixes spring-attic/spring-cloud-aws#262 Closes spring-attic/spring-cloud-aws#419 Co-authored-by: Paul Warren <paul.warren@emc.com>
…aws#706) Sets content type to files uploaded to S3. Fixes spring-attic/spring-cloud-aws#262 Closes spring-attic/spring-cloud-aws#419 Co-authored-by: Paul Warren <paul.warren@emc.com>
I see that org.springframework.cloud.aws.core.io.s3.SimpleStorageResource.SimpleStorageOutputStream.finishSimpleUpload() doesn't take into account the content-type of the content.
Can you take it into account and find a solution?
Regards.
The text was updated successfully, but these errors were encountered: