Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

WebM files are served as Content-Type: application/octet-stream #30

Open
ccd0 opened this issue Jul 11, 2015 · 6 comments
Open

WebM files are served as Content-Type: application/octet-stream #30

ccd0 opened this issue Jul 11, 2015 · 6 comments

Comments

@ccd0
Copy link

ccd0 commented Jul 11, 2015

It should be video/webm; otherwise many browsers treat it as a download. Similarly .ogv should be video/ogg. .mp4 appears to be working correctly. I haven't tried any other types.

@Luminarys
Copy link
Contributor

I believe this is a result of two things: Nginx being set to default to application/octet-stream, and Fuwa simply serving files without any MIME type checking/setting. I'm sure Flask MIME operations are supported at some level and can be integrated fairly easily.

@Guad
Copy link
Owner

Guad commented Jul 11, 2015

Flask should detect the MIME type automatically. Maybe it's really limited?

@Luminarys
Copy link
Contributor

Is there not some form of more advanced MIME detection/header setting with Flask?

@Guad
Copy link
Owner

Guad commented Jul 11, 2015

Sure, you can pass mimetype to send_from_directory and do the detection yourself

@Luminarys
Copy link
Contributor

I assume Python has some way to read the first few bytes of any given file and return the MIME type. Using detection like that with manual mimetype setting should probably work.

@Guad
Copy link
Owner

Guad commented Jul 11, 2015

The file object on upload should have a content type var

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants