Table of Contents

Page "Media Upload"

ID 1909
Namespace: System.Device

Provides an interface for accessing the media on the client device.

Examples

MediaUpload.RunModal();
if MediaUpload.HasMedia() then begin
    MediaUpload.GetMedia(InStream);
...
end;
Clear(MediaUpload);

Properties

Name Value
Caption Media Upload
Editable False
LinksAllowed False
PageType Card
Extensible True
InherentEntitlements X
InherentPermissions X

Methods

IsAvailable

Checks whether media upload on the client device is available.

procedure IsAvailable(): Boolean

Returns

Type Description
Boolean

True if the media upload is available, false otherwise.

SetMediaType

Sets the type of media to select from.

procedure SetMediaType(MediaType: Enum "Media Type")

Parameters

Name Type Description
MediaType Enum System.Device."Media Type"

The type of media to upload.

SetUploadFromSavedPhotoAlbum

Sets the media source to Saved Photo Album. The default media source is Photo Library.

procedure SetUploadFromSavedPhotoAlbum(UploadFromSavedPhotoAlbum: Boolean)

Parameters

Name Type Description
UploadFromSavedPhotoAlbum Boolean

Whether to upload media from Saved Photo Album.

Remarks

Has no effect on Android.

GetMedia

Gets the picture or video that was chosen when the page was opened. An error is displayed if the function is called without opening the page first.

procedure GetMedia(var TempBlob: Codeunit "Temp Blob")

Parameters

Name Type Description
TempBlob Codeunit System.Utilities."Temp Blob"

The object to put the picture BLOB in.

HasMedia

Checks if the media is available and can be obtained with a method.

procedure HasMedia(): Boolean

Returns

Type Description
Boolean

True if the media is available, false otherwise.

Remarks

The media will not be available if the page was not opened (e. g. MediaUpload.RunModal() function was not called) or if the dialog was canceled.

GetMedia

Gets the picture or video that was chosen when the page was opened. An error is thrown if the function is called without opening the page first.

procedure GetMedia(InStream: InStream)

Parameters

Name Type Description
InStream InStream

The InStream to read the picture from.

See also