rzane / file_store

🗄️ A unified interface for file storage backends
MIT License
19 stars 3 forks source link

Allow `:content_type` and `:disposition` to be set when writing #27

Closed warmwaffles closed 2 years ago

warmwaffles commented 2 years ago

ExAws.S3 allows sending :content_type and :content_disposition when putting objects into storage. Other options are allowed, but in order to keep consistent with the current FileStore interface, we are only going to allow :content_type and :disposition to be sent.

https://hexdocs.pm/ex_aws_s3/ExAws.S3.html#put_object/4

warmwaffles commented 2 years ago

I still need to throw some tests up on here for S3, and will get to that later this evening.

warmwaffles commented 2 years ago

@rzane this is read to be looked at now. I added :type to the file stat so when the content type is grabbed from the store it can set a reasonable content type. I settled on application/octet-stream because that's what amazon returns when the content type is not specified, and it's a generic enough type that we should be fine.

warmwaffles commented 2 years ago

Should we add :disposition to the file stat? I'm unsure on that addition.

rzane commented 2 years ago

If it's useful to someone, I'm not opposed to adding it. But, for now, I think we can leave it out.