eXide
eXide copied to clipboard
Feature request: save as mime-type
When storing (text) documents of unkown mime-type in eXide, eXist complains about "content not allowed in prolog", i.e. not valid XML. Perhaps this should be addressed as eXist bug, but it could be solved in eXide by either retrieving the "correct" mime-type (not XML) or adding the option to save to a custom mime-type.
I'm not seeing this behavior when I create a new text document using File > New > Type: Other. What steps do you follow to see this error?
@joewiz Open the file again and try to save it.
@wshager I saved my file to /db/test.txt, reopened it, modified the file, and saved it. No errors or indications of a problem. I did the same with a new file without the .txt file extension - /db/blah - and got the same results. I monitored the PUT requests, and eXide correctly set the mime-type via the Content-Type header: Content-Type: text/text
. So I'm afraid I'm not seeing what you are. I'm using a current build of the develop branch, and the current eXide.
@joewiz Please read the original post: I meant unknown mime-type. Adding text in brackets may have been misleading.
I can't reproduce the error you're seeing. Please provide steps to reproduce.
@joewiz perhaps this has to do with the version of eXist?
Could be, but frankly that's speculation until you provide steps to reproduce the issue on your system.
@joewiz fair enough. I couldn't reproduce it either until I uploaded the file again using the manager. So the problem is in the storing by the db manager.
The default mime-type in xmldb:store seems to be application/xml. This probably should be addressed in eXist.
@wshager Please, just a few steps:
- upload file.bla using eXide db manager
- open file.bla in eXide
- save file.bla
@wshager that helps; since eXist-db is an Native XML database, by design when a document cannot be recognized, there is an attempt to write it as an XML file.
@dizzzz ok agreed. So perhaps it would nice to have an option to add custom mime-types.
There is something alike on database level; I am not aware how the relation is with eXide though. I did not verify it manually but it might help you.
<mime-types default-mime-type="foo/bar" default-resource-type="binary"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="schema/mime-types.xsd">
</mime-types>
@dizzzz ah yes of course, that ought to work. I'll give it a try.
I'll label this as a request for enhancement. Are you still interested, @wshager?
In the meantime, the mime type of any stored resource can be modified via eXide's File Manager > Properties pane: