小编st_*_*han的帖子

如何从 JavaScript 中的任意字符串创建有效的文件名?

有没有办法将任意字符串转换为 Javascript 中的有效文件名?

\n\n

结果应尽可能接近原始字符串,以便于人们阅读(因此slugify不是一个选项)。这意味着它只需要替换操作系统不支持的字符。

\n\n

例如:

\n\n
\'Article: "Un \xc3\xa9l\xc3\xa9phant \xc3\xa0 l\\\'or\xc3\xa9e du bois/An elephant at the edge of the woods".txt\'\n\xe2\x86\x92 \'Article   Un \xc3\xa9l\xc3\xa9phant \xc3\xa0 l\\\'or\xc3\xa9e du bois An elephant at the edge of the woods .txt\'\n
Run Code Online (Sandbox Code Playgroud)\n\n

我认为这将是一个常见问题,但我还没有找到任何解决方案。我希望你可以帮助我!

\n

javascript compatibility parsing

6
推荐指数
1
解决办法
5733
查看次数

如何使用 Node.js 从 Supabase Storage 保存文件(将 blob 转换为文件)

我正在 NodeJS 中使用 Supabase Storage 下载媒体文件(主要是图像)from.download()。

如何将作为文件返回的 Blob 保存在本地硬盘上?

buffer blob node.js supabase

5
推荐指数
1
解决办法
3649
查看次数

标签 统计

blob ×1

buffer ×1

compatibility ×1

javascript ×1

node.js ×1

parsing ×1

supabase ×1