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

Invalid MIME type at purchase invoice documents #29

Closed
dellermann opened this issue Jan 8, 2014 · 2 comments
Closed

Invalid MIME type at purchase invoice documents #29

dellermann opened this issue Jan 8, 2014 · 2 comments
Assignees
Labels
Milestone

Comments

@dellermann
Copy link
Owner

When I save a purchase invoice together with a document the document is correctly stored in the file system but the MIME type is not recognized correctly.

@ghost ghost assigned dellermann Jan 8, 2014
@dellermann
Copy link
Owner Author

I examined the problem and determined that the MIME type submitted by the browser is preferred. The MIME type check using Magic.getMagicMatch() is performed only if the browser doesn't supply a MIME type. It seems that some browsers don't submit valid types, e. g. most browsers on Windows submit text/html for all kind of files.

We should fix this in DataFile.populate().

dellermann added a commit that referenced this issue Jan 9, 2014
I fix issue #29 (Invalid MIME type at purchase invoice documents) by
using the MIME type from Magic.getMagicMatch() instead of the MIME type
submitted by the browser.

Furthermore, I write the Spock specification for it.
@dellermann
Copy link
Owner Author

Fixed in commit b1cb41c.

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

No branches or pull requests

1 participant