On Fri, Oct 9, 2015 at 9:02 PM, Roll, Kevin <[email protected]> wrote: > Simply adding that bundle to my app doesn't seem to do the trick. Also, it > looks like this discussion was centered on the Simple WebDav Servlet, however > I am using the POST Servlet in my case. Is there a way to configure the POST > servlet to use the content detection? My use case is low-volume enough that > this is acceptable.
Ah sorry, I though you were following the default launchpad and got a behaviour change due to the addition of this bundle. Robert > > -----Original Message----- > From: Robert Munteanu [mailto:[email protected]] > Sent: Friday, October 09, 2015 11:28 AM > To: [email protected] > Subject: Re: Uploaded file MIME type > > On Fri, 2015-10-09 at 13:17 +0000, Roll, Kevin wrote: >> So if I understand correctly there are two possibilities: >> >> 1. A bundle was added at some point which changed the MIME mappings >> for PNG. Am I correct in assuming that any change would be reflected >> in the MIME registry as viewed from the Web Console? The mapping >> looks correct in my current installation. > > Maybe > > SLING-4694 - Add ability to identify mime type based on file content > https://issues.apache.org/jira/browse/SLING-4694 > > is related? > > Robert > >> >> 2. Something has changed about the way the file is POSTed to the >> Sling servlet. I have not been able to identify any significant >> change, but my next step will be to debug this using a web proxy and >> compare now vs. 3 months ago. >> >> Are there any other things I should be looking at? >> >> >> -----Original Message----- >> From: Steven Walters [mailto:[email protected]] >> Sent: Wednesday, October 07, 2015 3:10 PM >> To: [email protected] >> Subject: Re: Uploaded file MIME type >> >> On Wed, Oct 7, 2015 at 2:46 PM, Roll, Kevin <[email protected]> >> wrote: >> >> > I am trying to upload a PNG file to the repository, using the >> > SlingPostServlet. The problem I am encountering is that the field >> > jcr:mimeType on the automatically created node ends up being >> > "image/x-png", >> > which is causing me a lot of trouble downstream because "x-" >> > indicates a >> > non-standard MIME type. Is this expected? Where does the "x-" come >> > from? >> > Referencing the documentation at >> > >> > >> > https://sling.apache.org/documentation/bundles/manipulating-content >> > -the-slingpostservlet-servlets-post.html >> > >> > >> > * jcr:mimeType -- The MIME type from the original file >> > submission (if >> > contained in the file body part) or derived from the original file >> > name >> > Even if I provide a file name of "whatever.png" I still get a MIME >> > type of >> > "image/x-png", so this doesn't work. I'm not sure I understand how >> > to put >> > the MIME type into my POST in order to set it explicitly. How can I >> > work >> > around this issue? >> > >> > As a point of interest I am almost certain that I was getting the >> > correct >> > type a few months ago. I haven't been able to determine what >> > change, if >> > any, introduced this issue. >> > >> > Thanks! >> > >> > >> Have you checked to see what the mime type registry has in place for >> the >> png extension? There's quite a number of rules for auto-selecting the >> mimetype, so reviewing the details on [1] would be my suggestion >> here. >> The mimetype registry may have changed without your knowledge, so >> confirming that it is correct (has the expected value) would be a >> first >> step. >> >> [1] >> https://sling.apache.org/documentation/bundles/mime-type-support-comm >> ons-mime.html >> >> >> -- >> Steven >
