Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
dim-anis opened this issue May 9, 2024 · 8 comments
Open
Assignees
Labels
P4: low Non-critical, workarounds exist type: bug 🐛 Something isn't working

Comments

@dim-anis
Copy link

dim-anis commented May 9, 2024

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):

  • @vendure/core version: 2.2.4
  • Nodejs version: 20.12.0
  • Database (mysql/postgres etc): postgres, local asset storage
@dim-anis dim-anis added the type: bug 🐛 Something isn't working label May 9, 2024
@michaelbromley
Copy link
Member

Hi,

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

@dim-anis
Copy link
Author

dim-anis commented Jun 6, 2024

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
Copy link
Member

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

@michaelbromley michaelbromley added the P4: low Non-critical, workarounds exist label Jun 17, 2024
@jawngee
Copy link

jawngee commented Nov 5, 2024

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

@michaelbromley
Copy link
Member

@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
Copy link

jawngee commented Nov 6, 2024

@michaelbromley

Yes, see here:

#3184 (comment)

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

@jawngee
Copy link

jawngee commented Nov 6, 2024

This is how it appears in minio's console:

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

@jawngee
Copy link

jawngee commented Nov 8, 2024

@michaelbromley
I think you need to pass ContentType to the upload object in the s3 storage strategy class. See my comment: #3184 (comment)

Thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
P4: low Non-critical, workarounds exist type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants