![]() ![]() ![]() It takes up space and will require clean up. The biggest issue with this is that now, on the server side, we have a physical file to manage. The issue with this is that it leaves the location of the document exposed for further download after the initial request, which might not be that much of a problem. Generate Server Side MethodĪnother method would be to generate the document on the server side and provide a URL to download the file once it’s ready. There is also the issue that if you’re using JWT then the request in the new window will fail because it doesn’t contain the Authorization token in the header when performing a GET request. One method might be to open that request in a tab and then force the download, but the experience of that takes the user away from the central application. There are a few ways you can do this to get the user to automatically start downloading the file. Let’s say you want to make a request to an API endpoint for a PDF or other document. Download API Files With React & Fetch What Is This?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |