feat(webui): add file upload for mobile/remote devices (Fixes #1233)#1241
Merged
piorpua merged 4 commits intoiOfficeAI:mainfrom Mar 18, 2026
Merged
feat(webui): add file upload for mobile/remote devices (Fixes #1233)#1241piorpua merged 4 commits intoiOfficeAI:mainfrom
piorpua merged 4 commits intoiOfficeAI:mainfrom
Conversation
Contributor
Author
audichuang
added a commit
to audichuang/AionUi
that referenced
this pull request
Mar 10, 2026
Collaborator
|
我的装置,没有看到入口呀 |
9559df0 to
6bfb210
Compare
Collaborator
|
@audichuang 感谢贡献 基本功能运行正常,请拉取主干最新代码避免后续冲突,即将合并 |
…AI#1233) - Add POST /api/upload endpoint with multer (30MB limit, path traversal protection) - Platform-aware PasteService and FileService (Electron IPC vs WebUI HTTP) - FileAttachButton component with dropdown (Host Files / My Device) - Workspace toolbar upload button for WebUI - File size toast notifications and upload loading state - i18n for 6 languages (en/zh-CN/zh-TW/ja/ko/tr) - Unit tests for resolveUploadWorkspace
6bfb210 to
26caf6a
Compare
Contributor
Author
|
@ringringlin 感谢审核! 目前的实现不限制文件类型,在手机/移动设备上也可以上传图片以外的文件(PDF、文档、代码文件等),唯一的限制是单个文件大小不超过 30MB。关于拉取主干代码的部分,已经完成 rebase,目前是最新状态。 |
Collaborator
|
@肥勃 (audichuang) audi友友,有个疑问,我刚才在测试的时候 我的手机好像无法上传除图片以外的文件 ,是因为我的手机浏览器权限问题嘛,如我刚才share的图片所示,只能upload image |
Resolve bun.lock conflict by regenerating via bun install.
piorpua
approved these changes
Mar 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






Summary
Implements file upload for WebUI (mobile/remote devices) as specified in #1233.
What Changed
Backend –
POST /api/uploadLIMIT_FILE_SIZE→ 413 handlersanitizeFileName(path-traversal protection, CJK filename decoding)resolveUploadWorkspace: validates conversation workspace from DB, rejects mismatches_aionui_<timestamp>suffix{workspace}/uploads/Frontend – SendBox
FileAttachButtoncomponent: Electron → original button; WebUI → dropdown with Host Machine Files / My DeviceFileAttachButtonsendbox.tsxpassesconversationIdtouseDragUploadandusePasteServiceFrontend – Services
FileService.uploadFileViaHttp: client-side size guard +fetchmultipart uploadFileService.processDroppedFiles: platform-aware (Electron IPC vs WebUI HTTP)PasteService.createTempFile: unified helper for both platformsbuildDisplayMessage: preserveuploads/subdirectory for workspace-internal pathsFrontend – Workspace
useWorkspacePaste: newhandleUploadDeviceFiles(hidden<input>for browser file picker)useWorkspaceDragImport: passesconversationIdfor WebUI HTTP uploadsworkspace/index.tsx: WebUI-only+toolbar button with dropdowni18n – 6 new keys across 6 languages (en/zh-CN/zh-TW/ja/ko/tr)
Tests – 10 unit tests (4 for
resolveUploadWorkspace, 6 forbuildDisplayMessage)Security
/api/upload(multipart incompatible with tiny-csrf; protected by API token auth + rate limiter)path.basename()+ dangerous char removal + post-write resolved-path verificationChecklist
{workspace}/uploads/Closes #1233