Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a file with the same name exists during export PDF/Docx, it will be automatically renamed #11357

Closed
Achuan-2 opened this issue May 12, 2024 · 14 comments
Assignees
Milestone

Comments

@Achuan-2
Copy link
Member

Achuan-2 commented May 12, 2024

导出pdf、word如果文件被占用,弹窗提示用户

In what scenarios do you need this feature?

目前导出pdf,如果之前已经导出过一次,这个pdf已经用Adobe Acrobat等pdf阅读软件占用,再导出同名pdf,不会提示文件被占用
只会一直显示正在导出

导出word也有这个问题

Describe the optimal solution

导出pdf、word,如果同名文件被占用,弹窗提示用户

Describe the candidate solution

No response

Other information

No response

@TCOTC
Copy link
Contributor

TCOTC commented May 12, 2024

要是导出的目录下存在同名文件,也需要提示

@Achuan-2 Achuan-2 changed the title 导出pdf如果文件被占用,弹窗提示用户 导出pdf、word如果文件被占用,弹窗提示用户 May 12, 2024
@88250
Copy link
Member

88250 commented May 12, 2024

要是导出的目录下存在同名文件,也需要提示

这个请单独开 issue。

@88250
Copy link
Member

88250 commented May 12, 2024

要不咱直接改为发现同名文件就自动重命名,比如 xxx - 1.pdf 这样的?

@88250 88250 self-assigned this May 12, 2024
@TCOTC
Copy link
Contributor

TCOTC commented May 12, 2024

合理

@TCOTC
Copy link
Contributor

TCOTC commented May 12, 2024

我建议是这样:

  • xxx.pdf
  • xxx(2).pdf
  • xxx(3).pdf

不要 xxx(1).pdf

判断存在 xxx.pdf 后继续判断是否存在 xxx(2).pdf ...


不只是导出 PDF ,其他导出可能也要

@88250
Copy link
Member

88250 commented May 12, 2024

那就不存在 #11358 的问题了,抱歉麻烦你了。

@TCOTC
Copy link
Contributor

TCOTC commented May 12, 2024

@88250 有个问题,现在批量导出 Markdown 时如果存在同名文件是怎么处理的?

@88250
Copy link
Member

88250 commented May 12, 2024

我记得是文件名后面加随机数

@88250 88250 changed the title 导出pdf、word如果文件被占用,弹窗提示用户 If a file with the same name exists during export, it will be automatically renamed May 12, 2024
@TCOTC
Copy link
Contributor

TCOTC commented May 12, 2024

我记得是文件名后面加随机数

image

@88250
Copy link
Member

88250 commented May 12, 2024

哦哦,加的是文档 ID。

@88250
Copy link
Member

88250 commented May 12, 2024

@Vanessa219 /api/file/getUniqueFilename

@88250 88250 changed the title If a file with the same name exists during export, it will be automatically renamed If a file with the same name exists during export PDF/Docx, it will be automatically renamed May 12, 2024
@TCOTC
Copy link
Contributor

TCOTC commented May 12, 2024

If a file with the same name exists during export PDF/Docx, it will be automatically renamed

那除了 PDF/Docx 之外的是不需要吗?

88250 added a commit that referenced this issue May 12, 2024
@88250
Copy link
Member

88250 commented May 12, 2024

其他的是通过浏览器下载,浏览器会自动处理。

@88250 88250 modified the milestones: 3.0.14, 3.0.15 May 12, 2024
Vanessa219 added a commit that referenced this issue May 18, 2024
@88250
Copy link
Member

88250 commented May 19, 2024

导出 docx 不再删除已经存在的文件 #8822

88250 added a commit that referenced this issue May 19, 2024
88250 added a commit that referenced this issue May 19, 2024
@88250 88250 closed this as completed May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants