Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when attempting to download static file #800

Open
randyDarsh opened this issue Oct 10, 2023 · 0 comments
Open

Error when attempting to download static file #800

randyDarsh opened this issue Oct 10, 2023 · 0 comments

Comments

@randyDarsh
Copy link

randyDarsh commented Oct 10, 2023

I'm thought I solved my issue using FileSaver, and it was working, but now I'm back to getting the same error.

I have two template files, both of which are .xlsx file types. They are static, and are in the public directory of my react application.

I have a function that is called from clicking a Link component.

The method is as follows:

const downloadTemplate = () => {
    try { 
        var isFileSavedSupported = !!newBlob;
   } catch (e) {
        enqueueSnackbar('Unsupported brower. Downloading is not permitted', {variant: 'error'});
        return;
   }
   if(!settings.bulkUpload) {
        FileSaver.saveAs(process.env.PUBLIC_URL + "/scoping-sheet/ScopingSheet.xlsx", "ScopingSheetTemplate.xlsx", {autoBom: true});
    else {
        FileSaver.saveAs(process.env.PUBLIC_URL + "/scoping-sheet/Bulk-scoping-sheet.xlsx", "BulkScopingSheetTemplate.xlsx", {autoBom: true});
    }}

When attempting to download either of the files using Edge (version 117.0.2045.60) and in Chrome (version 117.0.5938.150), on the download tab of each browser, I receive "Couldn't download - Network Issue" and "Failed - Network Error" respectively.

Any ideas would be appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant