javascript - android中的navigator.share api更改用户共享文件的名称
问题描述
我创建了一个 .csv 文件来下载它。在 Windows 中一切正常,但在 android 中,当共享文件时,它会以不同的名称下载,例如“share9457849389.csv”
const file = new File([text], 'myFile.csv', {
type: 'text/csv'
})
if (navigator.canShare && navigator.canShare({
files: [file]
})) {
navigator
.share({
files: [file],
text: 'Some text',
title: `The title`
})
.then(() => resolve(''))
.catch((e: any) => reject(e))
} else reject('Bad news')
我该如何解决这个问题?
解决方案
推荐阅读
- c# - 使用 c# web api 从远程服务器读取 CSS 文件内容
- jenkins - Jenkins 流水线和共享库的区别
- magento2 - 如果在 store->configuration 中启用扩展,则以编程方式生成发票和装运
- java - 如何实现多选recyclerview?
- android - 如何从数组编辑文本中获取字符串
- c++ - 为什么会出现分段错误
- javascript - 对 Spring Boot Endpoint 的 Ajax 请求读取 HTTP MSG 失败
- vba - 编辑自动转发的电子邮件以在开始时删除行
- javascript - 如何上传项目中但不属于 Firebase 存储输入的图像?
- ruby-on-rails - 如何使用 Nokogiri 将具有名称空间的节点树插入现有 XML 文件?