mirror of
https://github.com/peter-tanner/AliExpress-Invoice-Downloader.git
synced 2024-11-30 11:30:17 +08:00
Replace windows illegal filename characters with '_'.
This commit is contained in:
parent
bf96b9f97b
commit
0ff76556a2
|
@ -43,7 +43,10 @@
|
|||
}
|
||||
|
||||
function sanitizeFileName(name) {
|
||||
const sanitized = name.replace(/[^\x00-\x7F]/g, "").replace(/\s+/g, "_");
|
||||
const sanitized = name
|
||||
.replace(/[^\x00-\x7F]/g, "")
|
||||
.replace(/\s+/g, "_")
|
||||
.replace(/[/\\?%*:|"<>]/g, "_"); // Remove illegal filename characters
|
||||
return sanitized.substring(0, 16);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user