eXide icon indicating copy to clipboard operation
eXide copied to clipboard

Feature request: save as mime-type

Open wshager opened this issue 9 years ago • 16 comments

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.

wshager avatar Sep 10 '15 11:09 wshager

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 avatar Sep 10 '15 11:09 joewiz

@joewiz Open the file again and try to save it.

wshager avatar Sep 10 '15 11:09 wshager

@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 avatar Sep 10 '15 13:09 joewiz

@joewiz Please read the original post: I meant unknown mime-type. Adding text in brackets may have been misleading.

wshager avatar Sep 10 '15 13:09 wshager

I can't reproduce the error you're seeing. Please provide steps to reproduce.

joewiz avatar Sep 10 '15 13:09 joewiz

@joewiz perhaps this has to do with the version of eXist?

wshager avatar Sep 10 '15 13:09 wshager

Could be, but frankly that's speculation until you provide steps to reproduce the issue on your system.

joewiz avatar Sep 10 '15 13:09 joewiz

@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.

wshager avatar Sep 10 '15 13:09 wshager

The default mime-type in xmldb:store seems to be application/xml. This probably should be addressed in eXist.

wshager avatar Sep 10 '15 13:09 wshager

@wshager Please, just a few steps:



joewiz avatar Sep 10 '15 15:09 joewiz

  • upload file.bla using eXide db manager
  • open file.bla in eXide
  • save file.bla

wshager avatar Sep 11 '15 12:09 wshager

@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 avatar Sep 11 '15 12:09 dizzzz

@dizzzz ok agreed. So perhaps it would nice to have an option to add custom mime-types.

wshager avatar Sep 11 '15 12:09 wshager

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 avatar Sep 11 '15 12:09 dizzzz

@dizzzz ah yes of course, that ought to work. I'll give it a try.

wshager avatar Sep 11 '15 12:09 wshager

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:

screen shot 2017-03-12 at 5 07 36 pm

joewiz avatar Mar 12 '17 21:03 joewiz