mirror of
https://gitea.phreedom.club/localhost_frssoft/bloat.git
synced 2025-05-10 13:58:46 +00:00
add media description submit (very woozy way, but it works as possible)
This commit is contained in:
parent
58a2a1748e
commit
cfddec036c
6 changed files with 26 additions and 7 deletions
|
@ -431,7 +431,7 @@ func (c *Client) Search(ctx context.Context, q string, qType string, limit int,
|
|||
return &results, nil
|
||||
}
|
||||
|
||||
func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *multipart.FileHeader) (*Attachment, error) {
|
||||
func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *multipart.FileHeader, descr string) (*Attachment, error) {
|
||||
f, err := fh.Open()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
@ -441,7 +441,7 @@ func (c *Client) UploadMediaFromMultipartFileHeader(ctx context.Context, fh *mul
|
|||
var buf bytes.Buffer
|
||||
mw := multipart.NewWriter(&buf)
|
||||
fname := filepath.Base(fh.Filename)
|
||||
err = mw.WriteField("description", fname)
|
||||
err = mw.WriteField("description", descr)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue