OnDemand Users Group

Support Forums => ODWEK, Java and REST APIs => Topic started by: pankaj.puranik on April 14, 2011, 04:40:08 PM

Title: Getting a document as binary.
Post by: pankaj.puranik on April 14, 2011, 04:40:08 PM
Hi

Is it possible to get a document as a binary/byte array or something, file from CMOD.
After getting the binary file/byte, I would use my java classes to interprete and open the document with the correct viewer.

Is there an API that can help me with this?

Thanks
Pankaj.
Title: Re: Getting a document as binary.
Post by: Alessandro Perucchi on April 15, 2011, 06:26:12 AM
Hello Pankaj,

I'm not sure to understand your question... I mean, you can save binaries in CMOD (like MP3, ZIP, DIVX, ...) so it means you can also retrieve them as is.

What do you mean exactly?

Cheers,
Alessandro
Title: Re: Getting a document as binary.
Post by: Justin Derrick on April 15, 2011, 01:18:35 PM
Any retrieval from CMOD is a series of bytes.  All data is a series of bytes, when you think about it.

If you want to pull data into a program via API, then use the API and store the retrieved data locally (in memory or in a file) for processing.

I'm with Alessandro here -- I have no idea what you're actually trying to achieve.

-JD.
Title: Re: Getting a document as binary.
Post by: javed.khan on March 28, 2012, 06:42:01 AM
If I have understood you question correctly, there is a way where you can get the mimetype of the document you are downloading. But this is only possible if you have different Application Groups for different formats of document. If you have specified the format of the document in Application Group as user defined then there is no way to identify the type of document. A work around will be to add a TLE value of File Format and then decide the type of viewer using it.