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

Discussion

Discussion

Retrieve Physical File Path of TIFFs and E-Docs Using Entry ID in Laserfiche

posted on February 20 Show version history

Question: How can I retrieve the physical file path of TIFF images and electronic documents stored in Laserfiche using the entry ID?

Answer: You can use the following SQL script to pull the physical file path of TIFF images and electronic documents from the entry ID. This script includes a conditional check to handle both TIFF images and electronic documents (e-docs).

DECLARE @entryID INT = 123

SET @entryID = 123

SELECT 
    dbo.toc.name AS DocumentName, 
    dbo.doc.pagenum + 1 AS PageNum, 

    CASE 
        WHEN edoc_storeid IS NULL THEN
            dbo.vol.fixpath + '\' + 
            SUBSTRING(CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), dbo.doc.storeid), 2), 1, 2) + '\' + 
            SUBSTRING(CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), dbo.doc.storeid), 2), 3, 2) + '\' +
            SUBSTRING(CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), dbo.doc.storeid), 2), 5, 2) + '\' +
            CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), dbo.doc.storeid), 2) + '.TIF' 
        ELSE
            dbo.vol.fixpath + '\' + 
            SUBSTRING(CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), edoc_storeid), 2), 1, 2) + '\' + 
            SUBSTRING(CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), edoc_storeid), 2), 3, 2) + '\' +
            SUBSTRING(CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), edoc_storeid), 2), 5, 2) + '\' +
            CONVERT(VARCHAR(8), CONVERT(VARBINARY(4), edoc_storeid), 2) + edoc_ext 
    END AS FullPathAndFilename

FROM dbo.toc 
LEFT JOIN dbo.doc ON dbo.doc.tocid = dbo.toc.tocid
LEFT JOIN dbo.vol ON dbo.toc.vol_id = dbo.vol.vol_id
WHERE dbo.toc.tocid = @entryID
ORDER BY dbo.doc.pagenum;

Explanation:

  • DocumentName: The name of the document.
  • PageNum: The page number of the document.
  • FullPathAndFilename: The constructed full path and filename of the TIFF image or e-doc.

This script helps in retrieving the physical file path of TIFF images and electronic documents stored in Laserfiche by using the entry ID. Make sure to replace @entryID with the actual entry ID you are querying.

1 0
replied on February 20

One other solution that may be a bit easier, unless I am misunderstanding the question, is to right click on the entry you are interested in and select properties. In the box that opens, there are tabs along the top, select Document, and you will get the Volume ID, then select Page Info, and the pages and their path (relative to the repository folder location) will be listed. So if your repository folder is located at E:\LaserficheData, and the volume ID for the entry you are looking for is DEFAULT000123, and the pages location is 00\00\02\00000123.TIF, the path to your page is E:\LaserficheData\DEFAULT000123\00\00\02\00000123.TIF (the pages tab will also give you the location for all of the other pages, which should be in the same folder... but slight chance they could be in a different folder/volume ID than the first page)

1 0
replied on February 20

Reading or writing files directly from the volume is discouraged. It bypasses all access rights checking and auditing and ignores if other users have the document locked or checked out. Your volumes should be tightly locked down so that only the Laserfiche server has the ability to read or write those files, so in a recommended configuration this path would be inaccessible to any program that tried to use it.

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

Sign in to reply to this post.