Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
36c9fbb
feat(mail): add large attachment support via medias/upload API
chanthuang Apr 14, 2026
fe1b496
refactor(mail): remove legacy size check, add 3GB limit, integrate +send
chanthuang Apr 14, 2026
826d7d7
feat(mail): quote-aware HTML insertion, +draft-edit support, cleanup …
chanthuang Apr 14, 2026
041cf67
fix(mail): align large attachment HTML IDs with desktop client
chanthuang Apr 15, 2026
b165a79
docs(mail): document large attachment behavior in skill references
chanthuang Apr 15, 2026
ac3ad1e
fix(mail): pass signature-injected HTML to processLargeAttachments
chanthuang Apr 15, 2026
e25abaa
fix(mail): skip draft.Apply when all ops consumed by large attachment…
chanthuang Apr 15, 2026
12883a3
fix(mail): add X-Lms-Large-Attachment-Ids header in draft-edit large …
chanthuang Apr 16, 2026
22c714b
fix(mail): i18n large attachment HTML text aligned with desktop client
chanthuang Apr 16, 2026
f25b46a
fix(mail): insert large attachment card before quote wrapper, not ins…
chanthuang Apr 16, 2026
3c27fc4
feat(mail): unify large attachment handling in +draft-edit with norma…
chanthuang Apr 17, 2026
4f1433e
fix(mail): place signature before large attachment card consistently
chanthuang Apr 17, 2026
146eeb3
fix(mail): auto-preserve signature in set_body and set_reply_body
chanthuang Apr 17, 2026
1593853
fix(mail): use brand-aware display name in large attachment card title
chanthuang Apr 17, 2026
1488610
style(mail): apply gofmt
chanthuang Apr 17, 2026
dad9902
fix(mail): address review feedback on large attachment PR
chanthuang Apr 17, 2026
8bd6b70
fix(mail): recognize server-format X-Lark-Large-Attachment header in …
chanthuang Apr 20, 2026
e2e8178
fix(mail): skip large attachments in forward URL validation
chanthuang Apr 20, 2026
a9a3535
fix(mail): classify forwarded original attachments for large attachme…
chanthuang Apr 20, 2026
2427942
fix(mail): normalize large attachment header on draft edit to prevent…
chanthuang Apr 20, 2026
6c1cbe5
fix(mail): extract large attachment card from quote on forward
chanthuang Apr 20, 2026
704e64a
fix(mail): use octet-stream for re-embedded attachments and file-base…
chanthuang Apr 20, 2026
5deff56
fix(mail): address PR review — blocked extension bypass, index-based …
chanthuang Apr 20, 2026
a7b9733
fix(mail): preserve original content type for normal forwarded attach…
chanthuang Apr 20, 2026
8c3e8c1
fix(mail): reconstruct missing large attachment HTML cards on draft edit
chanthuang Apr 20, 2026
4859f7e
feat(mail): support large attachments in plain-text emails
chanthuang Apr 20, 2026
7fedee7
fix(mail): FindBodyPart skips attachment-disposition parts; update sk…
chanthuang Apr 20, 2026
31e0255
fix(mail): fix origIdx mismatch, predictable temp files, and attachme…
chanthuang Apr 20, 2026
8cec5bb
fix(mail): use composed body size and source inline bytes in EML size…
chanthuang Apr 20, 2026
158fdaa
fix(mail): merge large attachment items into single container on draf…
chanthuang Apr 21, 2026
66ef04e
feat(mail): add template management shortcuts and --template-id flag
infeng Apr 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions shortcuts/common/drive_media_upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ type DriveMediaUploadAllConfig struct {
ParentType string
ParentNode *string
Extra string
// Reader, when non-nil, is used as the upload source instead of opening
// FilePath. Callers must set FileName and FileSize explicitly. The reader
// is NOT closed by UploadDriveMediaAll; the caller owns its lifetime.
Reader io.Reader
}

type DriveMediaMultipartUploadConfig struct {
Expand All @@ -49,11 +53,17 @@ type DriveMediaMultipartUploadConfig struct {
}

func UploadDriveMediaAll(runtime *RuntimeContext, cfg DriveMediaUploadAllConfig) (string, error) {
f, err := runtime.FileIO().Open(cfg.FilePath)
if err != nil {
return "", WrapInputStatError(err)
var fileReader io.Reader
if cfg.Reader != nil {
fileReader = cfg.Reader
} else {
f, err := runtime.FileIO().Open(cfg.FilePath)
if err != nil {
return "", WrapInputStatError(err)
}
defer f.Close()
fileReader = f
}
defer f.Close()

fd := larkcore.NewFormdata()
fd.AddField("file_name", cfg.FileName)
Expand All @@ -65,7 +75,7 @@ func UploadDriveMediaAll(runtime *RuntimeContext, cfg DriveMediaUploadAllConfig)
if cfg.Extra != "" {
fd.AddField("extra", cfg.Extra)
}
fd.AddFile("file", f)
fd.AddFile("file", fileReader)

apiResp, err := runtime.DoAPI(&larkcore.ApiReq{
HttpMethod: http.MethodPost,
Expand Down
Loading
Loading