Dear Nigel,
currently the only way is to transfer the file to the server and then add the document to the database. Another way is to add xml snippets like:
add as test <xml>test</xml>
You could use for this our bindings, too. (see http://www.inf.uni-konstanz.de/dbis/basex/bindings) So just write your own class like seen in the example.
For example (pseudo code):
FileInputStream fis = new FileInputStream(file); StringBuilder sb = new StringBuilder(); sb.add(fis.readLine()); session.execute("add as test " + sb.toString());
Kind regards, Andreas
Am 19.10.2010 17:00, schrieb Nigel Alderton:
Hi,
How can I upload an xml file from a client machine to the basex server?
After spending a couple of hours trying to use the "BaseX GUI" which apparently is not possible, I'm now trying to use the "basex client" instead.
I've managed to login from the client to the server by doing;
java -cp basex-6.2.2.jar org.basex.BaseXClient -U admin -P admin -n 192.168.2.10
then creating a database;
create db test open test
but when I try to upload a file by doing;
add text.xml
it says;
File or directory "C:/BaseX/test.xml" not found.
If I go to the server and create a file there called test.xml then go back to the client and do "add text.xml" it works! So the "add" command seems to add files on the server, not the client.
Is it possible to add a file / document to the server from a client, or can it only be done at the server?
Thanks,
Nigel
BaseX-Talk mailing list BaseX-Talk@mailman.uni-konstanz.de https://mailman.uni-konstanz.de/mailman/listinfo/basex-talk