• What is KendoReact
  • Getting Started
  • Server Components
  • Components
    • Animation
    • Barcodes
    • Buttons
    • Chartsupdated
    • Common Utilities
    • Conversational UIupdated
    • Data Gridupdated
    • Data Query
    • Data Tools
    • Date Inputs
    • Date Math
    • Dialogs
    • Drawing
    • Dropdownsupdated
    • Editor
    • Excel Export
    • File Saver
    • Formupdated
    • Ganttupdated
    • Gauges
    • Indicators
    • Inputsupdated
    • Labels
    • Layoutupdated
    • ListBox
    • ListView
    • Map
    • Notification
    • OrgChartnew
    • PDF Processing
    • PDFViewer
    • PivotGrid
    • Popup
    • Progress Bars
    • Ripple
    • Scheduler
    • ScrollView
    • Sortable
    • Spreadsheetupdated
    • TaskBoard
    • Tooltips
    • TreeList
    • TreeViewupdated
    • Upload
  • Sample Applications
  • Styling & Themes
  • Common Features
  • Project Setup
  • Knowledge Base
  • Changelog
  • Updates
  • Troubleshooting

saveAs

Prompts the user to save a file with a specified name and content.

The saveAs function is designed to work with Data URIs and Blobs and save them as files on the client machine. Under the hood, saveAs either creates a link that is clicked or a form that is submitted to the proxy end point if a proxy is used.

  • Saving a Blob with a proxy is not supported and will result in an error.
  • To download files from a server endpoint, use the regular HTML5 download attribute on an anchor tag to trigger the download.
import { saveAs, encodeBase64 } from '@progress/kendo-file-saver';

const dataURI = "data:text/plain;base64," + encodeBase64("Hello World!");
saveAs(dataURI, 'test.txt');

Parameters

data string | Blob

The content of the file as a Base64-encoded Data URI or a Blob.

fileName string

The desired file name.

options? SaveOptions

An optional proxy configuration to use during the file-saving operation. Ignored

In this article

Not finding the help you need?