mirror of
https://github.com/usememos/memos.git
synced 2025-06-05 22:09:59 +02:00
fix: s3 custom path (#1249)
This commit is contained in:
@@ -67,11 +67,12 @@ func (client *Client) UploadFile(ctx context.Context, filename string, fileType
|
|||||||
}
|
}
|
||||||
|
|
||||||
link := uploadOutput.Location
|
link := uploadOutput.Location
|
||||||
if link == "" {
|
// If url prefix is set, use it as the file link.
|
||||||
if client.Config.URLPrefix == "" {
|
if client.Config.URLPrefix != "" {
|
||||||
return "", fmt.Errorf("url prefix is empty")
|
|
||||||
}
|
|
||||||
link = fmt.Sprintf("%s/%s", client.Config.URLPrefix, filename)
|
link = fmt.Sprintf("%s/%s", client.Config.URLPrefix, filename)
|
||||||
}
|
}
|
||||||
|
if link == "" {
|
||||||
|
return "", fmt.Errorf("failed to get file link")
|
||||||
|
}
|
||||||
return link, nil
|
return link, nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user