How to Open Excel Files Directly from a Link in RadFileExplorer?

1 Answer 60 Views
FileExplorer
Dongwei
Top achievements
Rank 1
Dongwei asked on 22 Nov 2024, 08:34 AM

When I try to open a file I'd like to be able to click on a link to an Excel file and have it open directly in Excel on my computer, without any intermediate popup windows. Is this possible? or download to local?

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 22 Nov 2024, 08:56 AM

Hi Dongwei,

You can find an example that leverages RadFileExplorer for image preview and file download functionality to preview other file types like Excel in RadWindow. The open-pdf-word-excel-files-from-radfileexplorer.zip example is attached, and you can use it as a foundation for your custom document viewer implementation. Here are more details on the sample project:

  • OpenPdfFilesFromFileExplorer.aspx - This page includes the RadFileExplorer control and a custom JavaScript function that handles the double-click event on the files. Depending on the file extension, the RadPdfViewer or RadWindow will be used to preview the file.
  • PdfViewer.aspx - The PdfViewer.aspx page hosts the RadPdfViewer control. 
  • PdfViewer.aspx.cs - The code-behind PdfViewer.aspx.cs handles the file loading and conversion based on the file type.
  • web.config - specifies the mime types of the file formats that are not supported by default by the browser
      <system.webServer>
        <staticContent>
          <mimeMap fileExtension=".oft" mimeType="application/vnd.ms-outlook" />
          <mimeMap fileExtension=".msg" mimeType="application/vnd.ms-outlook" />
          <mimeMap fileExtension=".sql" mimeType="text/plain" />
        </staticContent>
    ...
    </system.webServer>

If you'd like to not convert the excel files (.xlsx file extensions) and proving them in the PdfViewer, but directly load them in RadSpreadsheet for ASP.NET AJAX then you can leverage the solution provided at Load Excel file into a read-only RadSpreadsheet. For your convenience I prepared and attached another example Open_Pdf_Word_Excel_Files_from_RadFileExplorer_in_RadSpreadsheet.

    Regards,
    Rumen
    Progress Telerik

    Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Telerik family, check out our getting started resources
    Tags
    FileExplorer
    Asked by
    Dongwei
    Top achievements
    Rank 1
    Answers by
    Rumen
    Telerik team
    Share this question
    or