在不同的目录中导出 excel 和 pdf

Export excel and pdf in different directory

我正在自学 kendo 网格,但找不到将 pdf 和 excel 导出到下载文件夹以外的其他目录的示例或演示。 目前,当我按下 "export to excel" 和 "export to pdf"

的按钮时,我的代码会自动将导出的文件下载到 "download" 文件夹

我试过 "saveAs()" 但这不是我要找的功能。这是我的代码。

                toolbar: ["create", "excel", "pdf"],
                excel: {
                    fileName: "Kendo UI Grid Export.xlsx",
                    filterable: true
                },
                pdf: {
                    allPages: true,
                    avoidLinks: true,
                    paperSize: "A4",
                    margin: { top: "2cm", left: "1cm", right: "1cm", bottom: "1cm" },
                    landscape: true,
                    repeatHeaders: true,
                    template: $("#page-template").html(),
                    scale: 0.8
                },

出于安全原因,您无法访问本地文件夹。因此无法定位您的导出本地文件夹。 Kendo 也有有趣的功能,考虑到您正在学习,保存文件(服务器端)的功能。 Here

举个例子

var dataURI = "data:text/plain;base64,SGVsbG8gV29ybGQh";
kendo.saveAs({
    dataURI: dataURI,
    fileName: "test.txt",
    proxyURL: "/path/to/proxy",
    forceProxy: true
});