Page 1 of 1

unable to download document using JAVA APIs

Posted: Mon Jul 15, 2019 7:46 am
by ajutate
im using getcontent() method to get document content based on docId.
but unable to download doc format like .docx,.xls,.jpg,png,pdf.
i recieved the content in binary format but cannot able to convert it into there actual format using JAVa apis.
want help for above issue.

Re: unable to download document using JAVA APIs

Posted: Thu Jul 18, 2019 2:42 pm
by agaspa
Using the method getContent() you will get the digital content (in bytes) of a document.
You should only write the stream on a file.
https://docs.logicaldoc.com/resources/w ... getContent

Of course in order to successfully save the document with the right filename and extension you should first request the system to get the metadata information of the document (file-name). the method to invoke is getDocument()
https://docs.logicaldoc.com/resources/w ... etDocument

Note: you can get code snippets from here: https://wiki.logicaldoc.com/wiki/Bindings_And_Samples