Opened 18 years ago
Closed 18 years ago
#433 closed defect (fixed)
Base1PluginExecutor doesn't set MIME type on files
Reported by: | base | Owned by: | Johan Enell |
---|---|---|---|
Priority: | minor | Milestone: | BASE 2.1.1 |
Component: | web | Version: | 2.1 |
Keywords: | Cc: |
Description
(using BASE 2.1 (2847) on Solaris 10 / Tomcat 5.5.17 / JDK 1.5.0_08)
When viewing files generated by plug-ins, filemanager always uses Content-Type "text/plain" in the HTML header. This works OK for images, but when trying to view "text/html" files generated by plugins, the files are not rendered properly, but are shown verbatim. It would be great if the filemanager used the same MIME mappings as the rest of tomcat (c.f. web.xml).
emill@…
Change History (4)
comment:1 by , 18 years ago
follow-up: 3 comment:2 by , 18 years ago
Summary: | filemanager always uses Content-Type "text/plain" → Base1PluginExecutor doesn't set MIME type on files |
---|
comment:3 by , 18 years ago
Thanks for the explanation. I'm continually impressed by how rich and well-designed the BASE2 architecture is - kudos to everyone!
I've done the following modification to our local copy of Base1PluginExecuter (sic) and it works like a charm:
1438,1439d1434 < newFile.setMimeTypeAuto(null, null);
It would be most helpful if this was fixed in future releases; as it turns out, this was all that was required to fix the problem behind ticket #434 in the first place!
/Emil
The file manager uses the MIME type set on the file. If no MIME type is set the default is used. The default MIME type is configured in the web.xml file located in the www/WEB-INF directory. The MIME type is usually set by the browser when uploading files or by checking the file extensions. In the case above it is probably the plugin that must set a MIME type on the file or call the File.setMimeTypeAuto() method to set a MIME type according to the file extension.