You are viewing limited content. For full access, please sign in.

Question

Question

How to set the contentStream when using Browser Binding and Form Post

asked on July 17, 2019

Hi all,

I'm able to create a document but not able to set the edoc parameters and content. My contentStream is a base64 encoded PDF.

Any assistance would be appreciated.

-Ben

 

2 0

Answer

SELECTED ANSWER
replied on September 30, 2019

Hey Ben,

 

I've done a little bit of work with CMIS, unfortunately it's mostly been either via the PortCMIS dll or direct web calls, while it looks like you're running your queries through Postman, so I'm not sure if my experience will directly relate.

 

It sounds like your process is resulting in an empty Laserfiche document with no PDF content? Are you getting any errors back from the request? Also, what URL are you using for the request?

 

There seem to be a couple differences between what you're trying to do and the upload process I've used for PDFs via http requests.

 

First, I didn't use base64 encoding for the content stream. I just wrote the FileStream directly to the RequestStream with a text/UTF-8 header. Viewing the request in Fiddler it appeared as follows:

-----------

Content-Type: text/plain; charset=utf-8

Content-Disposition: form-data; name="content"; filename="C:\Temp\PdfPages.pdf"

 

Test Text

1000

%PDF-1.6

%

1 0 obj

<</Type/XObject/BitsPerComponent 8/Subtype/Image/Width 40/ColorSpace/DeviceRGB/Filter/DCTDecode/Length 1172/Height 40>>stream

_JFIF___``C_____________________

(etc)

-----------

 

Second, we seem to have some differences in the included keys.

 

I did not include the last 3 PropertyId/Value pairs (lf:extension, cmis:contentStreamMimeType, and cmis:contentStreamLength.) CMIS/Laserfiche seemed able to determine those values based on the content stream itself. I also did not include the "folderId" or "Id" keys. I'm guessing that "Id" in this case is the CMIS repository name. With the method I used those values were specified in the URL:

http://[MyServer]/lfcmis/browser/[RepostioryId]/root?objectId=[FolderId]

 

I also had two key/value pairs which don't seem to be in your list:

"versioningState", "none"

"succinct", "true"

However I'm not sure if those are significant or not.

 

Hopefully looking at some of those differences will point you in the right direction!

 

 

 

 

3 0
replied on August 5, 2020

Hi Geoffrey,

This looks good, thanks! What version of the CMIS service are you using? I'll check this out when I'm back on the task. Also, I don't remember the answers you questions but will get back to you when I can.

-Ben

 

0 0

Replies

replied on August 26, 2019

/bump

1 0
replied on September 30, 2019

/bump

1 0
replied on August 1, 2019

Hi Ben, could you please help me with an update for your case, was possible to upload the file for the document i'm facing the same issue here with cmis. Thanks for your help.

0 0
replied on August 1, 2019

Hi Robinson,

I didn't get issue solved and moved on to higher priority work for now. I'd still like to find a solution eventually.

-Ben

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.