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 Reply 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.