在Kendo Upload中显示Base64字符串中的初始文件

时间:2018-06-04 04:59:26

标签: kendo-ui kendo-grid kendo-asp.net-mvc kendo-upload

如何从Base64字符串设置Kendo Upload的初始文件。以下是我到目前为止的代码,

        var imgBG = new Image();
        imgBG.src = "data:image/jpg;base64,BASE64 String Here";
        imgBG.name = "Current Background Image.jpg";

        $("#files").kendoUpload({
            select: imageValidationMessages,
            async: {
                saveUrl: "Save",
                removeUrl: "Remove",
                autoUpload: true
            },
            localization: {
                select: 'Select Image',
                remove: 'Remove Image',
                cancel: 'Cancel'
            },
            multiple: false,
            files:
                [{
                    name: imgBG.name,
                    size: 2097152,
                    extension: ".jpg"
                }]
        });

0 个答案:

没有答案