files

Gets or sets the attached files in the PromptBox. When called without arguments, returns the current files array. When called with an array, sets the attached files.

Parameters

files Array (optional)

An array of file objects to set. If omitted, returns the current files array.

Returns

Array The array of attached files when called without arguments.

Example - getting files

<div id="promptbox"></div>
<button id="get-files">Get Files</button>
<script>
var promptbox = $("#promptbox").kendoPromptBox({
    fileSelectButton: true,
    placeholder: "Attach files..."
}).data("kendoPromptBox");

$("#get-files").click(function() {
    var files = promptbox.files();
    console.log("Attached files:", files);
});
</script>

Example - setting files

<div id="promptbox"></div>
<script>
var promptbox = $("#promptbox").kendoPromptBox({
    fileSelectButton: true,
    placeholder: "Attach files..."
}).data("kendoPromptBox");

promptbox.files([
    { name: "document.pdf", size: 1024 },
    { name: "image.png", size: 2048 }
]);
</script>
In this article
files
Not finding the help you need?
Contact Support