【问题标题】:Syncfusion filemanager download file not workingSyncfusion文件管理器下载文件不起作用
【发布时间】:2021-04-11 11:32:02
【问题描述】:

我正在使用同步融合文件管理器。我想要做的是下载一个文件。文档说要下载文件,只需在ajaxSettings 中设置downloadUrl。但是当我实现这个并尝试右键单击并下载时,页面被重定向到我在 downloadUrl 中给出的 url。

组件.ts

import { FileManagerComponent } from '@syncfusion/ej2-angular-filemanager';
...
this.ajaxSettings = {
    url: baseAPIUrl + '/file-operation',
    uploadUrl: baseAPIUrl + '/file-upload',
    downloadUrl: baseAPIUrl + '/file-download'
}

component.html

<ejs-filemanager id='default-filemanager' #filemanagerObj [ajaxSettings]='ajaxSettings' [view]='view'>
</ejs-filemanager>

在查看文档时,很难找到解决方案,并且没有任何有关下载文件的有用信息。谁能帮帮我,提前谢谢。

【问题讨论】:

    标签: angular syncfusion file-manager ej2-syncfusion


    【解决方案1】:

    请按照以下步骤运行 FileManager 组件。

    1. 从以下链接克隆 ASP.NET 核心文件提供程序服务,

    服务链接:https://github.com/SyncfusionExamples/ej2-aspcore-file-provider

    1. 使用 Visual Studio 运行解决方案文件。

    2. 在下面示例的 app.component.ts 文件中添加 localhost 地址。

    https://stackblitz.com/edit/angular-filemanager-core-service-vvfa24?file=app.component.ts

    1. 现在,FileManager 组件将呈现。下载操作适用于上述示例。

    请参阅以下链接以了解有关文件管理器组件的更多信息。

    文档:https://ej2.syncfusion.com/angular/documentation/file-manager/getting-started/

    演示:https://ej2.syncfusion.com/angular/demos/#/material/file-manager/overview

    API:https://ej2.syncfusion.com/angular/documentation/api/file-manager/

    【讨论】:

      猜你喜欢
      • 2016-01-06
      • 1970-01-01
      • 2018-06-10
      • 1970-01-01
      • 2014-05-13
      • 1970-01-01
      • 2015-04-27
      • 1970-01-01
      相关资源
      最近更新 更多