Hi all, 

Uploading files via the Webdav servlet results to wrong content types under Mac 
OS X.

I mount a Jackrabbit (version 2.2.5) workspace under Mac OS X and copy files 
(e.g. images) using the Finder.
The problem is that the file is stored in the repository always as 
application/xml (javax.jcr.Property.JCR_MIMETYPE) regardless what file is 
copied.

As a workaround I wrote a Servlet-Filter that sets the Content-Type according 
to the http path. This filter is processed just before the WebdavServlet.
While the PUT operation is processed the content type is read from the http 
request header inside 

  org.apache.jackrabbit.server.io.ImportContextImpl.ImportContextImpl(Item, 
String, InputContext, InputStream, IOListener, Detector) line 81.

However the "real" mimetype is determined using Apache Tika (it seems the 
Content-Type is just a hint or so...).

I have no idea why this leads always to "application/xml" when using MAC OS as 
client (maybe the stream is missing some magic bytes).

Does anybody have an idea how to fix this? Is there a way to force Jackrabbit 
to use a certain content-type. 
A workaround using a filter or so would be fine for me...

Thanks in advance and best regards

udo

Reply via email to