Unverified Commit 31399fe4 authored by boojack's avatar boojack Committed by GitHub

fix: s3 custom path (#1249)

parent e1505992
......@@ -67,11 +67,12 @@ func (client *Client) UploadFile(ctx context.Context, filename string, fileType
}
link := uploadOutput.Location
if link == "" {
if client.Config.URLPrefix == "" {
return "", fmt.Errorf("url prefix is empty")
}
// If url prefix is set, use it as the file link.
if client.Config.URLPrefix != "" {
link = fmt.Sprintf("%s/%s", client.Config.URLPrefix, filename)
}
if link == "" {
return "", fmt.Errorf("failed to get file link")
}
return link, nil
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment