Table of Contents
About #
GraffitiUploaderSingle is a diverse single file upload control with chunked data transfer for efficient and correct transfers.
Enumerations #
This class exposes no enumerations.
Constants #
This class exposes no constants.
Events #
Name | Parameters | Return Type | Description |
---|---|---|---|
FileCleared | None | None | Value has been cleared by the user. |
FileSelected | None | None | A file has been selected by the user. |
UploadBegun | None | None | The upload process has started. |
UploadCompleted | None | None | The upload process has completed. |
UploadProgress | value as Double | None | The upload process has progressed. |
Methods #
Name | Parameters | Return Type | Description |
---|---|---|---|
AcceptedTypes | None | String() | Returns an array of the selectable file types. |
AcceptedTypes | value() as String | None | Sets the accepted file types. MIME type of extension. IE: Array( “.png”, “video/mpeg” ). Default is PNG, BMP, and GIF. |
IsUploading | None | Boolean | Returns whether an upload operation is currently active. |
PreviewTypes | None | String() | Returns an array of file MIME types that are currently automatically previewed. |
PreviewTypes | value() as String | None | Sets the MIME types of files that are automatically previewed. |
Reset | None | None | Resets the control to its default state. |
Value | None | GraffitiWebFile | Returns the current GraffitiWebFile value. |
Properties #
Name | Type | Default Value | Description |
---|---|---|---|
AllowFileDrops | Boolean | True | Controls whether users can drag and drop files to select. |
AutoUpload | Boolean | False | When True, once a user has selected an acceptable file, the upload will automatically commence. |
ClearButtonIndicator | WebSDKUIControl.Indicators | Default | Indicator applied to the clear button. |
ClearButtonStyle | GraffitiStyle | Nil | GraffitiStyle applied to the clear button. |
ClearButtonText | String | “×” | Text or HTML caption of the clear button. Also accepts FontAwesome icon definitions. |
ClearButtonTooltip | String | “Clear” | Text displayed in the tooltip of the clear button. |
ClearButtonVisible | Boolean | True | Determines whether the clear button will be present in the control’s UI. |
MaximumFileSize | Integer | 0 | Maximum allowed file size in bytes. 0 = Unlimited. |
PreviewIndicator | WebSDKUIControl.Indicators | Default | Indicator applied to the preview area. May be obscured by the file preview itself. |
PreviewPopover | Boolean | True | When True and the user holds their cursor over the preview area, a larger preview of the selected file will be shown. |
PreviewStyle | WebStyle | Nil | WebStyle applied to the preview area. |
PreviewVisible | Boolean | True | Determines whether the preview area will be present in the control’s UI when a selection has been made. |
ProgressBackgroundIndicator | WebSDKUIControl.Indicators | Default | Indicator applied to the background of the progress bar during upload processes. |
ProgressBackgroundStyle | GraffitiStyle | Nil | GraffitiStyle applied to the background of the progress bar during upload processes. |
ProgressForegroundIndicator | WebSDKUIControl.Indicators | Default | Indicator applied to the value and text displayed within the progress bar during upload processes. |
ProgressForegroundStyle | GraffitiStyle | Nil | GraffitiStyle applied to the value and text displayed within the progress bar during upload processes. |
ResetWhenComplete | Boolean | False | When True, the control will reset to no value when an upload has completed. |
SelectButtonIndicator | WebSDKUIControl.Indicators | Default | Indicator applied to the select button. |
SelectButtonStyle | GraffitiStyle | Nil | GraffitiStyle applied to the select button. |
SelectButtonText | String | “Select” | Text or HTML within the select button. |
SelectButtonTooltip | String | “Choose a file” | Text displayed within the select button’s tooltip. |
SelectButtonVisible | Boolean | True | Determines whether the select button will be present in the control’s UI. |
TemplateFileSelected | String | “{name} ({size})” | Template text that is parsed to display selection information. |
TemplateProgress | String | “Uploading… {name} ({value})” | Template text that is parsed to display upload progress information. |
TemplateUploadComplete | String | “Uploaded {name}” | Template text that is parsed to display information when an upload has completed. |
TextDragOver | String | “Drop file to select” | Text or HTML displayed within the control’s label when a file is dragged over it. |
TextFileRejected | String | “Unsupported file type selected” | Text or HTML displayed when the user has attempted to select or drop a file that is not allowed by the AcceptedTypes defined. |
TextFileTooLarge | String | “File is too large” | Text or HTML displayed when the user has attempted to select or drop a file that is larger than the MaximumFileSize property’s value. |
TextNoValue | String | “No File Selected” | Text or HTML displayed when no file is currently selected. |
UploadButtonIndicator | WebSDKUIControl.Indicators | Default | Indicator applied to the Upload button. |
UploadButtonStyle | GraffitiStyle | Nil | GraffitiStyle applied to the Upload button. |
UploadButtonText | String | “Upload” | Text or HTML displayed in the upload button. |
UploadButtonTooltip | String | “Begin uploading” | Text displayed in the upload button’s tooltip. |
UploadButtonVisible | Boolean | True | Determines whether the upload button will be present in the control’s UI. |
UploadPath | FolderItem | Varies by target | Path to store uploaded files. Defaults Xojo Cloud: SpecialFolder.Documents.Child( “com.graffitisuite.uploader” ) All others debug: SpecialFolder.Temporary.Child( “com.graffitisuite.uploader” ) All others built: SpecialFolder.ApplicationData.Child( “com.graffitisuite.uploader” ) |
Notes #
Template Tags #
The following words, when enclosed if curly braces, will be replaced with the currently selected file’s matching information:
- name
- size
- value