ASNA Monarch® Framework 10.0

Uploader Controls

What is a DdsUploader?

ASNA Mobile Support includes the DdsUploader control which allows users to upload files (.pdf, .bmp, .png, and so on) easily to the IBM i.

Applicability: This control works with Monarch, Mobile RPG, and/or Wings.

DdsUploader Property Tasks

These are the DdsUploader's property tasks:

Property

Notes

Appearance

Caption The caption that will be displayed adjacent to the control.

Upload

Directory Full path to upload storage in the IFS. This is a constant value established at design time. The path includes all directories and file name.
DirectoryField & DirectoryFieldLength These properties define a character field whose runtime value is to be used as the full path to the IFS file. If these properties are set, the Directory property is ignored.
NameField & NameFieldLength These properties define a character field whose runtime value is either the original filename or the basis for a new one.

Layout

Height &
Width
These properties define the width and height of the uploader control.

The Mechanics of a DdsUploader

The DdsUploader control works by simply transferring files that are selected via a standard Windows "choose a file" dialog to an IBM i Directory. This breaks down to a three-step process:

  1. The user will see the control much as it is presented below.

  2. Clicking the control opens a standard "choose a file" dialog, as shown below.

  3. After uploading the filename will be shown instead of the caption text. A user may then click or tap on the red X to doscard the file, or click on the filename to select another file and replace the current one.

Alternatively, users can simply drag and drop a file (on most browsers; only IE doesn't support it) from their desktop to the control. This is, also, a three step process:

  1. The user selects a file they want to upload (from Windowes Explorer for example) then starts a Drag operation (by holding the left mouse button on a traditional PC).
  2. The user can then drag the file onto the uploader, where the icon will change.
  3. Finally, the users releases the mouse button press ("Dropping" the file), the DdsUploader receives the file (as if it was selected from a dialog box).

Web.config Requirements

Because large file uploads are considered a security vulnerability, the following Web.Config values must be changed if it's intended for users to be able to upload large files.

  1. executionTimeout (default is 110 seconds)
  2. maxRequestLength (default 4MB)

DdsUploaderExample

<mdf:DdsConstant ID="DriverLicenseLabel" runat="server" Text="Driver's License:" 
  style="display: block; float: left; padding-top: 4px; padding-right: 12px; margin-left: 3rem;"
/>
<mdf:DdsUploader ID="DriverLicenseFile" runat="server"
  UploadLocation="ThisWebSite"
  Caption = "Click to select Driver's license file"
  Directory = "UploadedFiles"
  NameField = "UPNAME"
  NameFieldLength ="128"
/>