Download & Upload Buttons

The aim of these buttons is to provide the ability to upload and download files to the browser for use in CODESYS code.

A typical use case would be to upload a file (csv) with pre-configured settings, then read them into CODESYS and assign values from this file to variables within the code. Or the reverse process of saving a setting to a file and having it downloaded.

CODESYS sample project

In order for it to work properly, the buttons must be used with a combination of CODESYS code.

You can find uploadDownload (PRG) in a uploadDownload (PRG) in a sample project, or see this code for more details.

Add download button

  1. To add a download or upload button to the editor, just click its icon and it will be displayed in the container.
  2. Now bing the variable to sDownload/sUpload (from the project)

After clicking a button in the frontend area, the action is triggered:

  • Downloading a file previously saved in the eDesignUpload folder (/var/www/eDesign/customer/upload/load) under the filename stored in the sDownload variable.
  • Upload a file opens the dialog, and after finding the file, the file is uploaded to the eDesignUpload folder and the file name is written to the sUpload variable.