Skip to main content

Upload to FTP

Overview​

Accpack Upload SFTP is a working example process that demonstrates how to collect PDF files from a document's folder in Object Storage and upload them to a destination FTP or SFTP server. While it can be used, it is intended as a starting point, not a finished, production-ready solution.

The process keeps the logic simple: it collects all PDFs for a given document and uploads them all. In a real implementation you would typically embed the upload step into your own PDF publishing process, adding logic to match your specific requirements.

Installation​

The deployment package is available on the priint webftp storage, in the priint_suite_accpacks folder under AccPackUploadToFtp. Please contact our support for access. To deploy the package, see Using Accelerating Package in your Project. This will install the required plugins.

Deploy the included AccPack Upload Sftp.bpmn as a Camunda process separately. The process definition is also available as a download at the bottom of this page.

Before running the process, confirm that:

  • You have access to the destination FTP/SFTP server with credentials and write permission to the target folder.
  • PDF files for the document already exist in MinIO at the document's PDF folder path.

Configure FTP Credentials in Payara​

Store the FTP connection details as Payara server properties rather than hardcoding them in the BPMN. Go to Payara Admin → Server (Admin Server) → Properties and add the following:

Payara server properties

PropertyRequiredDescriptionExample
FtpServerYesHostname or IP address of the FTP/SFTP server.ftp.priint.com
FtpPortYesPort number. Only 21 (FTP) and 22 (SFTP) are supported.22
FtpUserYesUsername for authentication.priint_user
FtpPasswordYesPassword for authentication.••••••••

Process Definition​

NameIdentifierObject TypeProcess Type
AccPack Upload SftpACCPACK_UPLOAD_SFTPDocumentSERVICE_PROCESS

ACCPACK_UPLOAD_SFTP

1. Collect PDF Files From Object Storage​

Queries the document's PDF folder in object storage and returns a list of PDF filenames based on the documentId and the selected pdfProfiles list.

  • If pdfProfiles is provided, only return PDF files that match the pattern: documentId + pdfProfile.
  • If pdfProfiles is empty, return only the default PDF file containing documentId.pdf.
  • If no matching files are found, the process marks itself as failed and does not proceed to the upload step.

User uploaded image

If the process runs as a main process, the start point provides a pdfProfiles list. If ACCPACK_UPLOAD_SFTP is used as a subprocess and the main process already provides pdfProfiles, use the start point without the form to avoid duplicate profile selection.

2. Upload File To SFTP​

The process retrieves the PDF files directly from object storage and uploads them to the FTP/SFTP server.

For each PDF file:

  1. Streams the file directly from object storage to the FTP server.

  2. Builds a new filename using the optional PREFIX and SUFFIX parameters:

    {PREFIX}{original_filename_without_extension}{SUFFIX}{.extension}

    Example: document_12345.pdf with PREFIX=priint_ and SUFFIX=_V1.0.0 → priint_document_12345_V1.0.0.pdf

  3. Uploads the file under the new filename. The original file in MinIO is never modified.

The PREFIX and SUFFIX values can be set as input parameters on the task or passed from a parent process.

3. Delete PDF Files From Object Storage​

To clean up after upload, the "Delete PDF Files From Object Storage" step removes the files collected in step 1 from MinIO. This step is optional.

Parameters​

The process uses two kinds of input. Static values (FTP connection details) are defined in the BPMN on the service task. Dynamic values are provided at runtime by the planner when starting the process.

The variables documentId, project, and tenant are provided automatically when starting the process with object type Document. The pdfFilesName list is produced by step 1 and passed forward automatically. It is not configured manually.

Collect PDF Files From Object Storage​

ParameterRequiredDescriptionExample
pdfProfilesNoList of PDF profile names to filter which files are collected. If empty, only the default PDF is returned.print, web

Upload File To SFTP​

User uploaded image

ParameterRequiredDescriptionExample
pdfFilesNameYesList of PDF filenames to upload. Produced by step 1. Not configured manually.
prefixNoText added before the filename (without extension) when uploading.priint_
suffixNoText added after the filename (without extension) when uploading._V1.0.0
ftpFolderNoRemote folder path to upload into. Defaults to /{FtpUser} if empty./upload

Delete PDF Files From Object Storage​

ParameterRequiredDescription
pdfFilesNameYesList of PDF filenames to delete. Produced by step 1. Not configured manually.

Known Limitations​

  • All PDFs are collected: The process uploads every PDF in MinIO for the document, regardless of which profile generated it. Running the process multiple times accumulates files and uploads them all on each run.
  • Credentials in the BPMN: The BPMN contains placeholder FTP credentials in the task parameters. Move these to Payara server properties (see Installation) before using in any real environment.

AccPack Upload Sftp.bpmn