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

Question

Question

using Workflow script to export Zip files

asked on December 3, 2019

Hello, 

I have a workflow that can export files to a windows folder. Works great with PDF's and Tiff's. I tried using it with a zip file(long story on why I'm doing this) and what is happening is that Workflow is creating a Zip file and then exporting my zip file into that zip file. I have tried 2 different ways with one of them using the Code from Bert Warren. https://answers.laserfiche.com/questions/148898/Workflow-to-Export-Document-to-Windows-Folder#166292

I'm on 10.4 for almost everything so I'm up to date. Just wondering if anyone else has seen this issue or what am I missing to get the original Zip file exported? 

This is the file that is created.

This is what is inside of my zip file. a zip inside a zip. 

0 0

Answer

SELECTED ANSWER
replied on December 3, 2019

That's odd. What happens if you download the ZIP from the client directly?

1 0

Replies

replied on December 3, 2019

Is the file already stored in ZIP format in the repository, or are you creating a new ZIP file?

0 0
replied on December 3, 2019

Its already a Zip. Essentially I have IA email archiver watching a service email that gets these Zip files. IA then drops it into the Repo, which then I want to export it to a folder to have a zip program extract it. I could do it with exchange but I would need to buy more software. We already have almost everything LF is offering! 

0 0
replied on December 3, 2019

If it is a ZIP in the repository, than all you need to use is the Electronic Document method for the document exporter.

Something like docExporter.ExportElecDoc(doc, path);

What code are you using that is creating a second ZIP file?

0 0
replied on December 3, 2019

I'm using

 ExportElectronic(doc, exportFolder);

currently. 

    // Write your code here. The BoundEntryInfo property will access the entry, RASession will get the Repository Access session
    try
    {
        // Get Setting for Exporting Image Documents
        String sImageToPDF = "False";
        // Get Path to Windows Folder for Exports
        String exportFolder = "C:\\LF Export For Zip Files";
        // Ensure the Destination folder exists
        System.IO.DirectoryInfo di = new System.IO.DirectoryInfo(exportFolder);
        if (!di.Exists)
        {
            // Create missing folder(s)
            di.Create();
        }
        // Only Export Documents
        if (IsEntryDocument(BoundEntryInfo))
        {
            // Get DocumentInfo object
            using (DocumentInfo doc = (DocumentInfo)BoundEntryInfo)
            {
                if (IsElectronicDocument(doc)) // Check if it is an electronic document
                {
                    // Export the electronic Portion of the document
                    ExportElectronic(doc, exportFolder);
                }
                else if (HasImagePages(doc)) // Check for Image pages
                {
                    if (sImageToPDF.ToLower() == "true")
                    {
                        // Export images to PDF
                        ExportImageDocumentToPDF(doc, exportFolder);
                    }
                    else
                    {
                        // Export images to TIFF
                        ExportImageDocument(doc, exportFolder);
                    }

 

0 0
SELECTED ANSWER
replied on December 3, 2019

That's odd. What happens if you download the ZIP from the client directly?

1 0
replied on December 3, 2019

Good idea Jason. When downloaded the behavior is the same. I used IA email archiver to bring it in. I just manually imported it and then ran my workflow and now everything is working. I made a bad assumption in thinking IA imported it correctly. I'll take a look at IA again.   

0 0
replied on December 4, 2019

Thank you for the help Jason. Turn out the files I'm getting are Zips inside of another Zip. I never have seen that before. So nothing wrong with LF, it's my vendor sending them to us in a weird way. 

 

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

Sign in to reply to this post.