-
Notifications
You must be signed in to change notification settings - Fork 10
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
Store (optional) content type provided in upload #25
Comments
Hi Guus, in relation to this issue, I've investigated the method Line 142: String ext = getExtension(fn.toString());
if (ext.isEmpty())
return null; // no extension Since Line 147: Line 137: // If we can't read ahead safely, just give up on guessing
if (!is.markSupported())
return null;
As a simple fix of this issue I am proposing to use another try ( final InputStream is = Files.newInputStream( path ) ) { to try ( final InputStream is = new BufferedInputStream(new FileInputStream( path.toFile() ))) { I have tested this little change in your code and was able to detect Thanks for your time and keep up the good work! |
Hi Pavel - thanks for your detailed analysis. Would you mind providing a PR with this change? |
Sure! PR created. Thanks |
When a file is being uploaded, an optional content type is provided.
The implementation needs to persist this data for later use, as Java cannot reliably detect the content type of file.
The text was updated successfully, but these errors were encountered: