VishnuPrasad
VishnuPrasad

Reputation: 1078

Syncfusion filemanager download file not working

I am using syncfusion filemanager. What I am trying to do is to download a file. The documentation says to downloading a file, only need to set the downloadUrl in ajaxSettings. But while I am implementing this and trying to right click and download, the page is getting redirected to the url which I have given in downloadUrl.

component.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>

While looking through the documentations, its hard to find a solution and there isn't any useful information regarding downloading file. Could someone help me, thanks in advance.

Upvotes: 0

Views: 898

Answers (1)

keerthana
keerthana

Reputation: 117

Please follow the below steps to run FileManager component.

  1. Clone the ASP.NET core file provider service from the below link,

Service link: https://github.com/SyncfusionExamples/ej2-aspcore-file-provider

  1. Run the solution file using Visual Studio.

  2. Add the localhost address in app.component.ts file of the below sample.

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

  1. Now, FileManager component will render. The download operation works fine with the above sample.

Please refer to the below links to know more about File Manager component.

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

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

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

Upvotes: 0

Related Questions