Repair corrupted odt

Maxim Monastirsky momonasmon at
Mon Nov 24 01:51:24 PST 2014

On Sunday 23 November 2014 12:01:32 Olivier Chorier wrote:
> Hello everybody,
Hi Olivier,

> I'm looking for a way to repair thousands of corrupted odt files. Those
> files have been corrupted after FTP send operations, for some reason.
> The "zip" structure seems corrupted. I tried using 7-zip to unzip and zip
> again the odt file, but it doesn't work every time.
> Libre Office can repair them every time, but I need to open, repair, save
> and close those files one by one.
> I wonder if a script or something like that could be used to repair those
> files. I can't do it manually because there is thousand of them. Ideally, I
> could check them, and repair them automatically using a bash or a java
> script...
The zip utility (of Info-ZIP) has the -F and -FF flags that should be able to 
recover your files. Anyway, if you want to use LibreOffice for that, you could 
use the attached Java code as a starting point. The key point in this code is 
to explicitly set the input filter name, and the "RepairPackage" property to 
true in the input MediaDescriptor.

-------------- next part --------------
A non-text attachment was scrubbed...
Type: text/x-java
Size: 2479 bytes
Desc: not available
URL: <>

More information about the LibreOffice mailing list