save-in icon indicating copy to clipboard operation
save-in copied to clipboard

Sanitize filename

Open def00111 opened this issue 7 years ago • 1 comments

You can look what mozilla is doing here: https://searchfox.org/mozilla-central/rev/9a3f8590f807d449e790c8ba0e39eb14f41066d8/toolkit/components/downloads/DownloadPaths.jsm#68

def00111 avatar Jun 24 '18 13:06 def00111

Thanks! I was aware of it, but hadn't thought of using theirs. There are considerations for platform differences (not so much Chrome compatibility as it's sanitized before hitting the extension), so it's not a straightforward copy and paste job. I've tried to be as broad and safe as possible when sanitizing filenames, so if you anyone has examples of downloads failing because of bad filenames please share them.

I'll take a closer look at what Firefox is doing once I get some time to sit down with it.

gyng avatar Jun 26 '18 08:06 gyng