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

Filename problem with last MaJ of cadastrapp #143

Closed
jusabatier opened this issue Nov 30, 2021 · 1 comment
Closed

Filename problem with last MaJ of cadastrapp #143

jusabatier opened this issue Nov 30, 2021 · 1 comment

Comments

@jusabatier
Copy link
Collaborator

Related with georchestra/cadastrapp#615

With the last MaJ of cadastrapp (georchestra/cadastrapp#598) which uses more recent libraries, we have some problems with file downloads on Chrome/Chromium for BP/RP and CSV.

Searching some solutions, it appear that character " in filename can be replaced by _ when handled by UI.

I think the problem can be here :

const fileNameMatch = contentDisposition.match(/filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/);

This regexp match the filename with ".

Should be replaced by :

    if (contentDisposition) {
        const fileNameMatch = contentDisposition.match(/filename[^;=\n]*=(['"])(.*?\2|[^;\n]*)(['"])/);
        if (fileNameMatch.length > 3 && fileNameMatch[2]) {
            name = fileNameMatch[2];
        }
    }
@jusabatier
Copy link
Collaborator Author

It look like it's solved with last release (rc20)

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