[dna-issues] [JBoss JIRA] Commented: (DNA-28) Create a sequencer to set the MIME type by processing the file contents
Michael Trezzi (JIRA)
jira-events at lists.jboss.org
Sat Jun 7 14:32:48 EDT 2008
[ http://jira.jboss.com/jira/browse/DNA-28?page=comments#action_12415954 ]
Michael Trezzi commented on DNA-28:
-----------------------------------
Problem I see with sequencers is that they don't get anything close to a filename so guessing mimetype based on file extension is quite hard. That leads to other problems as without file extension, all e.g. OpenOffice documents are application/zip, all source files all text/plain, etc.
Is there any other way how to get the currently sequenced node reference to search for other info?
> Create a sequencer to set the MIME type by processing the file contents
> -----------------------------------------------------------------------
>
> Key: DNA-28
> URL: http://jira.jboss.com/jira/browse/DNA-28
> Project: DNA
> Issue Type: Feature Request
> Components: Sequencers
> Reporter: Randall Hauch
> Priority: Minor
> Fix For: Future Releases
>
>
> This sequencer would process the file contents and set the jcr:mimeType property. One approach might be to do it based upon the file extension. Another might be to process the file content. A third would be to do both and to determine the best MIME type by using simple logic (e.g., weights) to determine if they conflict.
> Some techniques include JMimeMagic (see http://marvinlee.wordpress.com/2007/10/24/check-uploaded-file-mime-type-with-jmimemagic/); those summarized http://www.rgagnon.com/javadetails/java-0487.html; and even what's built into the JDK (http://www.simongbrown.com/blog/2003/12/09/getting_mime_types_with_java_net_filenamemap.html).
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the dna-issues
mailing list