georchestra / mapstore2-cadastrapp

repository for the mapstore2 version of cadastrapp
GNU General Public License v3.0
2 stars 10 forks source link

Filename problem with last MaJ of cadastrapp #143

Closed jusabatier closed 2 years ago

jusabatier commented 2 years ago

Related with https://github.com/georchestra/cadastrapp/issues/615

With the last MaJ of cadastrapp (https://github.com/georchestra/cadastrapp/pull/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 : https://github.com/georchestra/mapstore2-cadastrapp/blob/ae71948e206c188fbde35417e495f103c76f58e1/js/extension/utils/download.js#L29

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 commented 2 years ago

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