-
-
Notifications
You must be signed in to change notification settings - Fork 138
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
Version 2 does not like - application/x-ole-storage #343
Comments
Hi @kapso |
Hello, I'm having the same issue/question I do not understand exactly how this should be registered as a mime type in marcel, because Marcel appears to know it already as a parent mime type (like This content type is used as a fallback for some old office files, I'm afraid that registering it as
Ref: rails/marcel#54 I will investigate this further |
Ok I have found the issue. We needed to extend a bit our allowed content_types, we were only allowing The PR is ready, it should be released soon :) |
…ke---applicationx-ole-storage [Validator] Extend allowed content_types using Marcel (#343)
(reopened until released) |
@Mth0158 I tried v2.0.1, and now seeing this for
|
@kapso arf, I thought this release would have resolved all these issues |
I guess this is not a known mime type and it may make sense to add it to Marcel, but I also guess that this can mess up with existing files @Mth0158 can I ask why this validation check is required? |
@kapso I was a bit disturb by the fact that I was finding your content_type referenced in Marcel ... but here is the catch, the correct content_type is |
@tagliala the check is required because the gem will compare the validator given content_type options with the blob detected content_type. |
@Mth0158 thanks, yea lower case
|
@kapso, reading Marcel gem, I found that <mime-type type="application/zip">
<_comment>Compressed Archive File</_comment>
<tika:link>http://en.wikipedia.org/wiki/ZIP_(file_format)</tika:link>
<tika:uti>com.pkware.zip-archive</tika:uti>
<alias type="application/x-zip-compressed"/>
<magic priority="50">
<match value="PK\003\004" type="string" offset="0"/>
<match value="PK\005\006" type="string" offset="0"/>
<match value="PK\x07\x08" type="string" offset="0"/>
</magic>
<glob pattern="*.zip"/>
</mime-type> |
@Mth0158 thanks yea that fixed the zip issue. But now seeing this for
|
@kapso This one is really not found in Marcel, to make it work, you will need to extend Marcel behaviour with something like: Marcel::MimeType.extend "application/ino", extensions: %w(ino), parents: "text/plain" # Registering arduino INO files Be sure to define at least the |
@Mth0158 thanks for all your insights and also for the fixes I have a question that I would like to ask on Marcel's repo, but since we are discussing about mime types and parents, I would like to ask if you have an opinion about the following snippet from Marcel: Marcel::MimeType.extend "application/vnd.ms-excel", parents: "application/x-ole-storage"
Marcel::MimeType.extend "application/vnd.ms-powerpoint", parents: "application/x-ole-storage" We have issues on some email messages from legacy Outlook clients being detected as I was expecting to see there also Marcel::MimeType.extend "application/vnd.ms-outlook", parents: "application/x-ole-storage" but it is not the case. Do you think that it should be there? |
Hi @tagliala, From my understanding, if some of your files are detected as It is detected as Marcel::MimeType.for io, name: filename.to_s, declared_type: content_type Rails: https://github.com/rails/rails/blob/main/activestorage/app/models/active_storage/blob.rb#L345 This method from Marcel returns the most precise content_type detected based on the content_types detected by each of its parameters. I guess that in your case, Marcel finds |
Some older versions of Microsoft Office documents use this type...
The text was updated successfully, but these errors were encountered: