vendure-ecommerce / vendure

The commerce platform with customization in its DNA.
https://www.vendure.io
Other
5.74k stars 1.02k forks source link

`mime-type` set to `application/octet-stream` when uploading `.glb` files #2844

Open dim-anis opened 6 months ago

dim-anis commented 6 months ago

Describe the bug Attempting to upload a .glb file results in an error. mime-type defaults to application/octet-stream instead of model/gltf-binary.

To Reproduce Steps to reproduce the behavior:

  1. Extend assetOptions.permittedFileTypes with model/gltf-binary or .glb
  2. Upload a .glb file through admin client
  3. Errors with "mime-type application/octet-stream is not allowed"

Expected behavior mime-type should be set to model/gltf-binary.

Environment (please complete the following information):

michaelbromley commented 5 months ago

Hi,

Are you able to provide a sample .glb file I can use for testing?

dim-anis commented 5 months ago

Sure, @michaelbromley! Github doesn't support attaching .glb files, so here is a link to gdrive.

https://drive.google.com/file/d/1Q904UoC-MsH1UiQ2QdddNjOsjFel1bXk/view?usp=sharing

michaelbromley commented 5 months ago

Thanks. I can reproduce this using the provided file.

I think this may be a current limitation of browsers, according to:

I think for now you may need to accept application/octet-stream for this to work

jawngee commented 2 days ago

This is happening with all file types with the s3 plugin as well. png, jpeg, etc all show up as application/octet-stream.

michaelbromley commented 2 days ago

@jawngee we are using the s3 plugin (with Minio) in prod in several projects and have not run into this. Are you able to provide steps to reproduce from a clean install?

jawngee commented 1 day ago

@michaelbromley

Yes, see here:

https://github.com/vendure-ecommerce/vendure/issues/3184#issuecomment-2459185222

A basic vendure install plus minio running in docker with the config in the linked comment.

jawngee commented 1 day ago

This is how it appears in minio's console:

Screenshot of Arc at Nov 6, 2024 at 5_04_26 PM