Originally posted by **AlexisEvo** November 21, 2023
When using S3 as a datastore, zipline does not set the MIME/content type of files it uploads to S3. This means if you attempt to load the files directly from the S3 provider, it will download the file rather than showing it in browser. I'm awful at typescript, but it looks like zipline already determines the MIME, so it just needs to be added to this putObject request:
https://github.com/diced/zipline/blob/fe50bebeba789f4126424f45007d115a1cb0dc82/src/lib/datasources/S3.ts#L24
My use case for this is that I've been using ShareX with Backblaze B2 for a while. B2 lets you use a custom domain name through CloudFlare and does not charge egress bandwidth for it. So I can have `zipline.example.com` pointing to my docker instance, and `i.example.com` pointing to CloudFlare which points to the B2 public bucket. ShareX gives me a link like `i.example.com/u/file.jpg` and it could transfer TBs of bandwidth without me being charged.
B2's S3 API can automatically determine MIME type based on file extension, so for now I've just hacked it together by changing this line to
> await this.s3.putObject(this.config.bucket, file, data, { 'Content-Type': 'b2/x-auto' });
But it'd be nice if this were built in and vendor agnostic.
Discussed in https://github.com/diced/zipline/discussions/493