How can I create a dynamic file and then have user download it on a web app?

This page summarizes the projects mentioned and recommended in the original post on /r/reactjs

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • FileSaver.js

    An HTML5 saveAs() FileSaver implementation

  • If it's a relatively small amount of data (like 100mb or less), try https://github.com/eligrey/FileSaver.js it handles all the edge cases nicely.

  • StreamSaver.js

    StreamSaver writes stream to the filesystem directly asynchronous

  • If it's larger, it's complicated... https://github.com/jimmywarting/StreamSaver.js generally works, but is not 100% reliable. https://github.com/jimmywarting/native-file-system-adapter is supposed to be like a newer version of it, but I struggled to get it working. You can also use https://web.dev/file-system-access/ but it's only supported in Chrome.

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

    SurveyJS logo
  • native-file-system-adapter

    File system, based on the spec reference implementation

  • If it's larger, it's complicated... https://github.com/jimmywarting/StreamSaver.js generally works, but is not 100% reliable. https://github.com/jimmywarting/native-file-system-adapter is supposed to be like a newer version of it, but I struggled to get it working. You can also use https://web.dev/file-system-access/ but it's only supported in Chrome.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts