Expand my Community achievements bar.

decoding content of FSAPPLICATIONDATA_

Avatar

Former Community Member

I have a requirement to save a state of the partially processed form, on pageUp and pageDown. I am rendering HTML version of form. In this case the FormsResult object returns next/previous HTML page and I have no access to data for the complete form.

I cannot use the Data Integration Service since I do not have a valid object or PDF.

There is hidden variable on the HTML page called FSAPPLICATIONDATA_ which I would assume, contains the data. But it is binary stream and I don't know how to decode it and convert to the XML document expected by Integration service, or renderHTMLForm() method.

Is there any way how to decode this FSAPPLICATIONDATA_ variable?

Thanks

Alex

7 Replies

Avatar

Former Community Member

I would expect that it is base 64 encoded. If you can get it into a document variable there is a decode method on the doc object that will decode it for you.

paul

Avatar

Former Community Member

thanks for the help, but

It is a binary string, like:

H4sIAAAAAAAAAO0bXXPiOOy9v4Jh5h7BhEKBDu2Ok5g2M5CwiWm3fcmkkHaZKw0T6G7335+/YjuBAv267e3x0EaSJVmWZCEb0v3yNLsv......continue

I think it is compressed and encoded.

For Document object, you mean com.adobe.idp.Document ? There is no decode() method I can find in API. I am in Java servlet, not in JavaScript, or Workbench.

Alex

Avatar

Level 8

Adobe doesn't supply a java base64 encoder/decoder, but there are pleanty of them out there like the Apache commons one:

        org.apache.commons.codec.binary.Base64

        ...

byte[] decoded = Base64.decodeBase64( FSAPPLICATIONDATA_);

see:  http://commons.apache.org/codec/apidocs/org/apache/commons/codec/binary/Base64.html

Avatar

Former Community Member

Ok I thought you were in a process ...there is a decode on the document object in a setValue service. Anyways I am quite certain that it is a base 64 encoded string so if you do a web search I am sure that you will be able to find a base 64 decode library.

paul

Avatar

Former Community Member

I tried that, there is one codec in lc_client/thirdparty, which is apache 1.3.

It did not help, before decoding it was in ascii range, after it is a pure

binary like:

‹ í]sâ8콿‚aæÁ@¡@‡vÇIL›HØÄ´Û¾dRH»ÌºÛý

So, I guess, it is not Base64.

Any other suggestions?

Avatar

Former Community Member

I tried to convert the stream to Java object with:

        byte[] decodedData = Base64.decodeBase64(FSAPPLICATIONDATA_);
        ObjectInputStream objectIn = new ObjectInputStream(new ByteArrayInputStream(decodedData));

        Object obj = objectIn.readObject();

But it throws an exception java.io.StreamCorruptedException: invalid stream header

So, I would say, it is not a Java object

Alex

Avatar

Level 2

Hi Alex,

FSAPPLICATIONDATA_ is an base64 encoded binary zip file. This file contains for example the whole XFA structure of the form.

Michael