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

Question

Question

How to import file using Laserfiche Cloud API?

asked on May 28, 2024

I am able to pass the file when using a path, but cannot figure out how to pass it in when the file is in a byte array or base64 string. Is there an example or certain format that the endpoint expects?

0 0

Answer

SELECTED ANSWER
replied on May 29, 2024

Hi, here are a couple of our open source examples:

.NET

- .Net example that uses a stream

JS

- Retrieved from the SharePoint API and converted to a Blob

- Sample app that gets the file from a file input

- Nodejs example that uses a Blob

 

0 0
replied on May 30, 2024

Thanks!

0 0
replied on May 30, 2024

Michelle are you able to share the code you ended up using to get this to work?

0 0
replied on May 30, 2024 Show version history

Hi Blake,

 

I ended up using the RestSharp library and passing it in like this:

request.AddHeader("Content-Type", "multipart/form-data");
request.AddFile("electronicDocument", bytes, docName + ".pdf", "application/pdf");

 

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.