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

移动端导入大于 32M 的 Data 包失败 #5067

Closed
88250 opened this issue Jun 1, 2022 · 0 comments
Closed

移动端导入大于 32M 的 Data 包失败 #5067

88250 opened this issue Jun 1, 2022 · 0 comments
Assignees
Labels
Milestone

Comments

@88250
Copy link
Member

88250 commented Jun 1, 2022

https://ld246.com/article/1654062080736

原因是较大的文件需要使用系统临时目录,但是 go mobile 的系统临时目录没有权限写入。

import.go:101: import data failed: open /data/local/tmp/multipart-3362071982: permission denied

问题分析

ginServer.MaxMultipartMemory = 1024 * 1024 * 32 // 插入较大的资源文件时内存占用较大 https://github.com/siyuan-note/siyuan/issues/5023

之前是 4G,但是因为 #5023 改为了 32M,所以会用到系统临时目录。

解决方案

通过环境变量 TMPDIR 指定系统临时目录路径为 工作空间/temp

参考 golang os 包代码

image

@88250 88250 added the Bug label Jun 1, 2022
@88250 88250 added this to the 2.0.16 milestone Jun 1, 2022
@88250 88250 self-assigned this Jun 1, 2022
@88250 88250 changed the title 移动端导入 Data 失败 移动端导入大于 32M 的 Data 压缩包失败 Jun 1, 2022
@88250 88250 changed the title 移动端导入大于 32M 的 Data 压缩包失败 移动端导入大于 32M 的 Data 包失败 Jun 1, 2022
@88250 88250 closed this as completed Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant