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

Question

Question

Can the Self Hosted Laserfiche API download images?

asked on November 17, 2022 Show version history

Hey All

We recently got the Self Hosted Laserfiche API installed. It is working great.

I am able to use the API to download Electronic Documents from the repository fine

func (c *Client) DownloadEntry(ctx context.Context, downloadOpts DownloadEntryOpts) ([]byte, error) {
	rangeHeader := map[string]string{}

	if downloadOpts.DownloadChunk {
		rangeHeader["Range"] = fmt.Sprintf("bytes=%d-%d", downloadOpts.Start, downloadOpts.End)
	}

	resp, err := c.restyClient.R().
		SetContext(ctx).
		SetAuthToken(c.AccessToken).
		SetHeaders(rangeHeader).
		SetPathParams(map[string]string{
			"entryID": strconv.Itoa(downloadOpts.EntryID),
			"repo":    c.Repo,
		}).
		Get("/Repositories/{repo}/Entries/{entryID}/Laserfiche.Repository.Document/edoc")
	if err != nil {
		return nil, err
	}

	if resp.StatusCode() != 200 && resp.StatusCode() != 206 {
		return nil, fmt.Errorf("Got status %d from %s", resp.StatusCode(), resp.Request.URL)
	}

	return resp.Body(), nil
}

If an entry doesn't have an electronic document component, but instead has an image, can the Rest API also download that page/image? I see in the API docs we can manipulate pages, such as deleting them, but don't see any functionality for downloading/exporting images. Only Electronic Documents, but I may have overlooked it.

Thanks and any help would be greatly appreciated

0 0

Answer

SELECTED ANSWER
replied on November 17, 2022

Hi, if the entry is a "Document" type with an image component, then the Self Hosted API Server isn't able to download the image. If the entry is an image type like "PNG Image" or "JPEG Image", then it should be able to download the image.

We are looking into adding this feature in the future to be able to download the image component from an electronic document.

Also, currently the Self Hosted API Server only has the v1 API version.

3 0

Replies

replied on November 17, 2022

The Export call in v2-alpha looks like it can:

2 0
replied on November 17, 2022

Hey Samuel.

 

Is this available for Self Hosted? I only have v1 in the definitions. Is there another version I need to install?

0 0
SELECTED ANSWER
replied on November 17, 2022

Hi, if the entry is a "Document" type with an image component, then the Self Hosted API Server isn't able to download the image. If the entry is an image type like "PNG Image" or "JPEG Image", then it should be able to download the image.

We are looking into adding this feature in the future to be able to download the image component from an electronic document.

Also, currently the Self Hosted API Server only has the v1 API version.

3 0
replied on November 17, 2022

Thanks Jason! Glad to hear it's on the roadmap!

0 0
replied on June 8, 2023

Hi Jason Chan,

When will this option be available for Self Hosted API Server?

1 0
replied on June 8, 2023

Mahmoud,

We don't yet have a release estimate for self-hosted that would contain this feature.  We are currently working on finalizing the v2 feature set for Cloud, then we will work on getting those features in an update for self-hosted API Server.  Thanks for your patience!

 

Andrew

3 0
replied on June 18, 2024

@████████, is there an estimated release date for v2 of the Self-Hosted API?
We have a few clients needing this functionality. Thanks!

3 0
replied on June 19, 2024

I would also like to see progress on this. Our biggest integration point is our Tax Department and throughout our history with Laserfiche(which dates back to the early 2000s), store property records and photos as images in Laserfiche and not Electronic Documents.

They are our biggest department we write software integrations for, and until the API offers the ability to export images(as opposed to electronic documents), we are stuck writing integrations with the SDK as opposed to the API. Having this ability via the API would be a huge win.

replied on August 21, 2024

We also have clients that need to download LF (Image) documents (perferably converted to PDF) with either the Self-Hosted API or CMIS Gateway.  Is there any update on this being added functionality?

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

Sign in to reply to this post.