File control for uploading a single client-side file. See File Upload Area for multiple files.

When used in conjunction with NewEdit, additional control names are also returned. If the file control ID is Xyz then the parameters @XyzFileName, @XyzContentType, and @XyzContentSize are also posted. (ContentSize is only returned for legacy reasons and you can safely ignore its value. If you need to determine the length of your data then use the DATALENGTH function.)

  @Xyz varbinary(max),
  @XyzFileName nvarchar(300),
  @XyzContentType varchar(300),
  @XyzContentSize int

To display an existing file, use SoftadminApi.FileControl_CreateExistingFileToken. If the user has not changed the file when saving, an additional parameter @XyzFileId will be passed to the procedure containing the given file id.

It is possible to specify which file extensions the user can select from and the maximum file size allowed by creating an input validation using the File category.

Start value: Binary data generated by SoftadminApi.FileControl_CreateExistingFileToken.
Return value: Selected file from local/network hard drive.
Supported in: NewEdit


alt text
The "Choose File" button opens a standard file dialog where the user can select a file to upload.

Best practice


Use SoftadminApi.FileControl_CreateExistingFileToken in GetEditFields if you want to display an existing file. Otherwise use CONVERT(varbinary(MAX), NULL) in instead of returning file data which will be discarded anyway.