Media Upload Web Control Media Upload Web Control

Media Upload Web Control

Zack Cohen Zack Cohen

Overview

Use the Media Upload control to collect files from a user. This control will prompt the user to select an item for upload and return an asset reference to the uploaded asset. The final result of the control is a List of Assets.

Airhome-AssetInput.png

Control Properties

Type

The type of asset to accept. The default choices are Images, PDF, and video. If required to accept multiple types, add the asset types as an expression in quotes. 

For example: 

"image/jpeg, image/png, application/pdf, image/svg+xml, image/gif, audio/mpeg, video/mp4"

linkExpiration

The amount of time the asset should be available. Check out The Asset Data Type for further information on the expiration of assets.

imageSize

The asset input allows for resizing of assets as they are uploaded. This property is an object representing the width and height in pixels for the uploaded asset:

{ width: number, height: number }

thumbnailPlaceholderSrc

A URL to a placeholder image to be used while the asset is uploaded before a preview can be generated.

Note: because Airkit Apps are hosted from a secure, HTTPS, resource, all hosted images must be hosted on a secure site.

Control Actions

Value Changed

This event occurs every time the assets are contained within the associated asset list. Whether an item is added by the user uploading a new asset or one is removed by a user removing an asset via the delete button.

Styling and Theming

The Asset Input Web Control is a compound control containing many containers and labels. Each of the components is stylable based on the styles available to that component. To style, select the Asset Input in the Tree view. Under style selected, the component of the asset control to style and the style properties will appear in a popup.

Airhome-AssetInput-compositstyling2.png

Examples

Example 1: Signed PDF Input

An Asset Input can collect PDFs from users:

AirHome-AssetInput-uploadPdf.gif

Insert an Asset Input control into a Data Flow. Set the Type to:

application/pdf

Further Reading