Add Documents to ZIP

Can someone explain how to configure the "Add Documents to Zip" node? I just want to add the selected images to zip file. Thank you.

  Discussion posts and replies are publicly visible

Parents
  •  here is the process model that I'm going to use  "Add Documents to Zip".

  • 0
    Certified Senior Developer
    in reply to jeffreyt0001

    It's simple:

    "base document": The document to base the new document on. All files in the base document will be part of the new document. Any files that match documents being added will be replaced.

    "Create new document": Wether to create a new document or a new version of a document.

    in "New Document Name" and "New Document Desc" place the name and the description of the file zip created.

    in "Save In Folder" where you place the zip file.

    "Existing Document": The existing document to create the new version for. Must be provided if creating a new version. (of the file existing zip file if you want to replace, remember: you have to set "Create new document" to false.)

    "Documents To Add": The array of documents to add to the ZIP.

    "Document Paths":The array of paths (including file names, the path to use inside the zip created).

     

Reply
  • 0
    Certified Senior Developer
    in reply to jeffreyt0001

    It's simple:

    "base document": The document to base the new document on. All files in the base document will be part of the new document. Any files that match documents being added will be replaced.

    "Create new document": Wether to create a new document or a new version of a document.

    in "New Document Name" and "New Document Desc" place the name and the description of the file zip created.

    in "Save In Folder" where you place the zip file.

    "Existing Document": The existing document to create the new version for. Must be provided if creating a new version. (of the file existing zip file if you want to replace, remember: you have to set "Create new document" to false.)

    "Documents To Add": The array of documents to add to the ZIP.

    "Document Paths":The array of paths (including file names, the path to use inside the zip created).

     

Children
  • 0
    Certified Senior Developer
    in reply to jeffreyt0001

    ok, with constant.

    • basedocument: <empty>
    • create new document: false
    • New Document Name: "test.zip"
    • New Document Desc: <empty>
    • save in folder : select directory where you want to place the zip
    • Existing document: "test.zip" 
    • document to add: select which file you want to add (ex. file.txt)
    • directory path : "intro\file.txt" 

    obviously, if in "Get Selected Image" you fetch the document, you have to put in "document to add" parameter.
    in that case, assume is pv!myImage.

    • basedocument: <empty>
    • create new document: false
    • New Document Name: "test.zip"
    • New Document Desc: <empty>
    • save in folder : select directory where you want to place the zip
    • Existing document: "test.zip" 
    • document to add: pv!myImage
    • directory path : concat("intro\",document(pv!myImage, "name"),document(pv!myImage, "extension"))

    hope this will help you.

  • I got an error in "Existing Document" : 

    ExistingDocument must be provided when a new document isn't be created.

    Below are my inputs:

    • basedocument: <empty>
    • create new document: false
    • New Document Name: "BILLER NAME"
    • New Document Desc: <empty>
    • save in folder : UPAC P2B QR Image
    • Existing document: concat( "UPAC P2B QR Image\", document(1883829, "name"), document(1883829, "extension")) (ZIP FILE)
    • document to add: a!forEach(pv!subsDetails, fv!item.qrDocId)
    • directory path : a!forEach(pv!subsDetails,  concat(  "UPAC P2B QR Image\",  document(fv!item.qrDocId, "name"),  document(fv!item.qrDocId, "extension")))
  • I'm confused about what value will I input into the Existing document.

  • 0
    Certified Lead Developer
    in reply to jeffreyt0001

    Hi,

    You only need to pass exiting document if you are creating a new version of existing document (in case If your requirement never update any existing document don't pass any value to existing document).

    If your requirement is always creating new zip file every time when you adding new image files

    • basedocument: <empty>
    • create new document: true
    • New Document Name: "BILLER NAME.zip"
    • New Document Desc: <empty>
    • save in folder : UPAC P2B QR Image
    • Existing document: <empty>
    • document to add: a!forEach(pv!subsDetails, fv!item.qrDocId)
    • directory path :  a!forEach(pv!subsDetails,  concat(  "UPAC P2B QR Image\",  document(fv!item.qrDocId, "name"),  document(fv!item.qrDocId, "extension")))

    In case if you are creating a new version of an existing file 

    • basedocument: <empty>
    • create new document: false
    • New Document Name: "BILLER NAME.zip"
    • New Document Desc: <empty>
    • save in folder : UPAC P2B QR Image
    • Existing document: "BILLER NAME.zip"
    • document to add: a!forEach(pv!subsDetails, fv!item.qrDocId)
    • directory path :  a!forEach(pv!subsDetails,  concat(  "UPAC P2B QR Image\",  document(fv!item.qrDocId, "name"),  document(fv!item.qrDocId, "extension")))

     

  • thank you for this. I already created a zip file and add the image to the zip but I got a problem when I unzip the file, the file extension of the image is not included. Below is the output when I unzip the file.