Automatic uploading image with a webservice results in warnings

I create images using a java function based on a encoded base64 string. When creating this image i get a warning in my console when the image is somewhere shown in my application. Is there a way to prevent this warning. Could not find mime type for file '17' My java code is as follows: ByteArrayInputStream byteArrayIn = null; ByteArrayOutputStream byteArrayOut = null; byteArrayOut = new ByteArrayOutputStream(); Base64Utils.decode(imageContent, byteArrayOut); byteArrayIn = new ByteArrayInputStream(byteArrayOut.toByteArray()); Core.storeImageDocumentContent(this.getContext(), imageDocument.getMendixObject(), byteArrayIn, thumbWidth.intValue(), thumbHeight.intValue());
2 answers

Image inherits the Name attribute from FileDocument, you could set this attribute with something like picture.jpg (or a different extension based on what image type this is) before storing the image.


It searches for the mime type based on the "Name" attribute of the FileDocument. Set that and you should be ok.