This is great information - I have not seen the MIME type registry before. So, I see a mapping
image/png [*png*] ...which seems reasonable. I see no mapping for image/x-png, so step 1 appears OK. -----Original Message----- From: Steven Walters [mailto:steven.walt...@icidigital.com] Sent: Wednesday, October 07, 2015 3:10 PM To: users@sling.apache.org Subject: Re: Uploaded file MIME type On Wed, Oct 7, 2015 at 2:46 PM, Roll, Kevin <kevin-r...@idexx.com> 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-commons-mime.html -- Steven