|
@@ -51,11 +51,14 @@ export default {
|
|
this.saveNewFile(file);
|
|
this.saveNewFile(file);
|
|
},
|
|
},
|
|
saveNewFile(file){
|
|
saveNewFile(file){
|
|
|
|
+ const filename = file.name.normalize('NFD').replace(/[\u0300-\u036f]/g, "").replace(/[^a-zA-Z0-9_\-\.]/g, "_"); // Normalisation Unicode et suppression des accents
|
|
|
|
+ console.log('filename', filename);
|
|
|
|
+
|
|
const configs = {
|
|
const configs = {
|
|
headers: {
|
|
headers: {
|
|
'X-CSRF-Token': this.csrf_token,
|
|
'X-CSRF-Token': this.csrf_token,
|
|
'Content-Type': 'application/octet-stream',
|
|
'Content-Type': 'application/octet-stream',
|
|
- 'Content-Disposition': `file; filename="${file.name}"`,
|
|
|
|
|
|
+ 'Content-Disposition': `file; filename="${filename}"`,
|
|
},
|
|
},
|
|
};
|
|
};
|
|
|
|
|