Agile Developer

File upload fields in forms

Axpert 11
TStructs (Forms)
IViews
Scripts
Axpert Jobs
Axpert Cards
HTML Plug-ins
Users & Roles
Workflow
Axpert API
Application Var/Params
Publish Axpert Apps
Axpert Mobile
Settings
Utilities
Customization
WebServices
Axfast

File Uploads in Fields Form

These are fields that provide options to users to upload one or more files. Each file name will be shown as a tag within the field. The file names are stored in the field as comma-separated values. There can be more than one file-upload field in a form. These may be added to grid frames too. The name of a file-upload field should be prefixed with AxpFile_.

By default, the uploaded files are stored in a database table. The name of the database table will be TransId+FieldName. The transid is the name of the tstruct/form. The field name is the name of the file-upload field without the prefix AxpFile_.

Example:
If the transid is ‘form1’ and the file-upload field name is ‘axpfile_mydocs’, the table name will be form1mydocs.
It is not very efficient to store file uploads within the database. The uploaded files may be stored in a file server at a given path. Set the file server name in app variable named AxpFileServer<. The file path should be set in AxpFilePath.

If the file server is protected with a password, it should be set in AxpFileUser and AxpFilePwd.

Example:
To store in all files in a server named DocServer in path E:\Axpert\FileUploads with user name AxpertFileUploader, password Agile.01
Go to App Vars option under utils in developer site.Add the following vars:

AxpFileServer={\\docserver}
AxpFilePath={E:\Axpert\FileUploads}
AxpFileUser={AxpertFileUploader}
AxpFilePwd={Agile.01}

To change the path for a file-upload field in a form, add a field prefixed with AxpFilePath_. The field name should be the same as the file-upload field. The path set as a value in this field will be used to upload to the file server set in AxpFilePath app vars.

Example:
If the file-upload field name is Axpfile_mydocs, the file-upload-path field should be named AxpFilePath_mydocs. This field value should be the path (like E:\Axpert\SpecialDocs\). It may also contain along with server name like \\docserver\Axpert\SpecialDocs\.

A file name modifier may be added to the end of the file path suffixed with *..In that case, the file names will be added to the modifier string. If the file-upload-path field contains \\docserver\Axpert\SpecialDocs\202110101800*
If a file named “MyPhoto.jpg” is uploaded, it will be stored in
\\docserver\Axpert\SpecialDocs\202110101800myphoto.jpg

Barcode /QR code Scanner

To update data in the system using Barcode or QR code we can use the scan or file upload option. Create a simple text field with the “barqr_” prefix followed by the field name.

In the run site, a field to update the code is provided as shown below.

Click on the icon, a pop-up appears asking to begin scanning or upload an image to be scanned. Scan the image by granting camera permissions, the details will be updated in the dc

Click on “Scan an image file” to upload an image. A pop-up to upload the file appears as shown.

If the same QR code is scanned multiple times in the same dc then a pop-up notifying the duplication appears.

Try Out

Add a field for uploading the files or certificates based on the employee Qualification in dc2 of the Axbox employee form.