Does anyone have an example of using File Manager with a download function when using Razor pages?

1 Answer 872 Views
FileManager General Discussions
Marianne
Top achievements
Rank 1
Iron
Iron
Marianne asked on 24 Aug 2021, 08:26 PM

I have a web application that I am adding additional functions to.  The File Manager has just about everything I need (except to hide create folders).  But users have to have the ability to download files. (I kind of don't get how you can have a file manager without the ability to download files.)

Users will upload some CSV files, start a process & at end of process download log files created by the process. 

I see an example of how to extend File Manger but it just doesn't seem to fit the razor page model.  Can anyone point me towards some good examples of how to add that in?

1 Answer, 1 is accepted

Sort by
0
Stoyan
Telerik team
answered on 26 Aug 2021, 03:18 PM

Hello Marianne,

I am attaching a sample Razor Pages project that utilizes the Create Download Command For The File Manager Knowledge Base article.

The necessary modifications applied are:

  1. Point the window.location to the appropriate Action handler:
    var path = selectedFiles[0].path;
    window.location = '/FileManager?handler=Download&path=' + path;
  2. Set up the Download Action handler to respond to a Get request:
    public FileResult OnGetDownload(string path) { ... }

I hope the information above proves helpful.

Regards,
Stoyan
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
FileManager General Discussions
Asked by
Marianne
Top achievements
Rank 1
Iron
Iron
Answers by
Stoyan
Telerik team
Share this question
or