YutaMoriJP / Download-Generated-Text-File

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generate a text file and download it

This React app allows users to fill in the input fields like first name, last name, and file name. Clicking the button will generate a download link to the created text file. The content is in JSON format. The important component accepts a URL prop that can either be a blob object or the location of the resource. If it's a resource URL, it will fetch the resource and call Response.blob() and allow the user to download the requested resource. The Fetch button below the form sends an HTTP GET request to the jsonplaceholder API and generates a download link to the fetched content. The demo can be found here.

About


Languages

Language:JavaScript 92.4%Language:HTML 7.6%