We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
/asset/upload
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
最近在写挂件的时候调用Upload接口,为了不把文件都放在assets的第一层级,显得凌乱,需要把资源文件汇总到一个文件夹, 但是发现个问题
接口 /api/asset/upload 上传文件 参数: assetsDirPath: "/assets/folderName/" 成功创建文件夹,并且文件也上传成功_,但是接口返回的路径,并不包含 folderName, 因此导致无法直接使用返回的路径存到挂件的自定义属性上,只能自己拼接地址。 返回值如下: { "code": 0, "msg": "", "data": { "errFiles": null, "succMap": { "111.html": "assets/111-20230223092555-ab7pit7.html" } } }
API文档提及的 assetsDirPath: /Test Notebook/assets/ 存在同样问题
如果有大量数据需要存储,建议将这些数据通过[上传资源文件 API](https://github.com/siyuan-note/siyuan/blob/master/API.md#%E4%B8%8A%E4%BC%A0%E8%B5%84%E6%BA%90%E6%96%87%E4%BB%B6) 上传,然后将返回的资源文件地址通过设置属性接口(属性名使用 data-assets)保存在挂件自身的属性上。使用 data-assets 这个固定的属性名的目的是为了防止清理未引用资源时误删挂件数据文件。
No response
- Version: 2.7.6 - Operating System: macos - Browser (if used):
...
The text was updated successfully, but these errors were encountered:
🐛 API /asset/upload 使用子文件夹时返回结果不正确 Fix #7454
c0c605b
🐛 API /asset/upload 使用子文件夹时返回结果不正确 #7454
81fa346
88250
No branches or pull requests
该问题是否已经被报告过了? Is there an existing issue for this?
I have searched the existing issues
该问题是否能够在默认主题(daylight/midnight)下重现? Can the issue be reproduced with the default theme (daylight/midnight)?
I was able to reproduce the issue with the default theme
该问题是否可能是由于扩展功能导致? Could the issue be due to extensions?
I've ruled out the possibility that the extension is causing the problem.
描述问题 Describe the problem
最近在写挂件的时候调用Upload接口,为了不把文件都放在assets的第一层级,显得凌乱,需要把资源文件汇总到一个文件夹, 但是发现个问题
API文档提及的 assetsDirPath: /Test Notebook/assets/ 存在同样问题
期待的结果 Expected result
截屏或者录屏演示 Screenshot or screen recording presentation
No response
版本环境 Version environment
日志文件 Log file
...
更多信息 More information
No response
The text was updated successfully, but these errors were encountered: