I don't know where the difference comes from, are you sure the file.getName() call actually results in something valid? Though it shouldn't really matter, the mime type is simply the file extension, it won't affect anything else.
Edit: Oh I just re-read your question, this is explicitly about a file called 'xyz'? Then it makes sense, there is no file extension, thus no mime type.
By the way, you may want to use the Core.storeImageDocumentContent method instead if you want to be able to generate thumbnails etc.
You're giving the file the extension .Foto, that's not an official mime type so it won't be recognized. Not that it really matters, it just means browsers won't be able to open it without explicitly telling them that it's an image.