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

Question

Question

Incorrect file extensions in Laserfiche

asked on November 25, 2016 Show version history

One of our clients has a unusual issue where seemingly any file that has a period in the name has the text after the period treated as a file extension. 

 

For example this file is apparently a PNG but the numbers in the file name are treated as the extension so Laserfiche is unable to open it. 

 

Does anyone have experience with this? Any suggestions for solutions that might fix this for the thousands of files with the issue? I am wondering if we can just remove "." from all file names with workflow. 

1 0

Answer

SELECTED ANSWER
replied on November 28, 2016

Renaming the file in Workflow won't update the extension, the easiest way is to update the extensions manually in the database (back up the database first). This is stored in the edoc_ext and edoc_mime columns in the toc table. Use this type of SQL command to replace the extension on all documents with an extension beginning with "137":

update toc set edoc_ext = 'png', edoc_mime='image/png' where tocid in (select tocid from toc where edoc_ext like '137%')

Note the end of the command, it is finding all entries where the extension begins with 137. You will need to customize the command to replace other bogus extensions. To verify you are finding the correct documents, first run the subcommand 

select * from toc where edoc_ext like '137%'

Restart the LF server service after doing the update.

1 0

Replies

replied on November 28, 2016

It sounds like someone added those numbers to the end of the file name before importing into Laserfiche?  One way to fix those broken documents is to export the edoc, rename the local file to end in png, then replace the edoc with Tasks->Manage Electronic File. This will re-upload the edoc and set the extension to png.

2 0
replied on November 28, 2016

That is how I was able to update them as well but with thousands of files to fix its not very efficient. 

Will changing the file extension by renaming with workflow update the extension in document properties as well so that it will open without giving an error for unrecognized file extension? 

0 0
SELECTED ANSWER
replied on November 28, 2016

Renaming the file in Workflow won't update the extension, the easiest way is to update the extensions manually in the database (back up the database first). This is stored in the edoc_ext and edoc_mime columns in the toc table. Use this type of SQL command to replace the extension on all documents with an extension beginning with "137":

update toc set edoc_ext = 'png', edoc_mime='image/png' where tocid in (select tocid from toc where edoc_ext like '137%')

Note the end of the command, it is finding all entries where the extension begins with 137. You will need to customize the command to replace other bogus extensions. To verify you are finding the correct documents, first run the subcommand 

select * from toc where edoc_ext like '137%'

Restart the LF server service after doing the update.

1 0
replied on November 28, 2016

Wow you are amazing!! That is exactly what I was looking for. 

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

Sign in to reply to this post.