Reputation: 1078
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
Reputation: 117
Please follow the below steps to run FileManager component.
Service link: https://github.com/SyncfusionExamples/ej2-aspcore-file-provider
Run the solution file using Visual Studio.
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
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