kitware-resonant / django-s3-file-field

A Django library for uploading files directly to AWS S3 or MinIO Storage from HTTP clients.
Apache License 2.0
36 stars 6 forks source link

Ensure content type and filename information is appropriately passed to storage #201

Open brianhelba opened 3 years ago

brianhelba commented 3 years ago

Ideally, this would result in MinIO / S3 automatically setting the Content-Type and Content-Disposition (the filename portion) headers for every download.

This probably involves setting the appropriate S3-Object metadata when the object is first created. The particular headers should be empirically verified. This may be a starting point for S3 headers.

The original information about the filename and content type should probably come from the client, but the server may also be able to infer content type (see #52).

This was originally reported in #197.

dchiquito commented 3 years ago

I can confirm that setting Content-Type and Content-Disposition will result in those values being set as HTTP headers on download. The AWS multipart upload docs indicate that those metadata fields can be specified as headers when initializing a multipart upload. The server can make informed guesses about the correct values and also accept values from the client.

brianhelba commented 3 years ago

@dchiquito Just to clarify, you tested these headers on both AWS S3 and MinIO?

dchiquito commented 3 years ago

Indeed I did.