I guess not every image is pikachu
This commit is contained in:
parent
2f5bb2ff36
commit
111a33bc8a
@ -14,6 +14,7 @@ import (
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
@ -120,6 +121,8 @@ func (u *Upload) RemoveMarkupTempFile() {
|
||||
func (u *Upload) processUpload() error {
|
||||
daulog.SendLog(fmt.Sprintf("Uploading: %s", u.OriginalFilename), daulog.LogTypeInfo)
|
||||
|
||||
baseFilename := filepath.Base(u.OriginalFilename)
|
||||
|
||||
if u.webhookURL == "" {
|
||||
daulog.SendLog("WebHookURL is not configured - cannot upload!", daulog.LogTypeError)
|
||||
return errors.New("webhook url not configured")
|
||||
@ -184,7 +187,7 @@ func (u *Upload) processUpload() error {
|
||||
imageData = filedata
|
||||
}
|
||||
|
||||
request, err := newfileUploadRequest(u.webhookURL, extraParams, "file", "pikachu.png", imageData)
|
||||
request, err := newfileUploadRequest(u.webhookURL, extraParams, "file", baseFilename, imageData)
|
||||
if err != nil {
|
||||
log.Printf("error creating upload request: %s", err)
|
||||
return fmt.Errorf("could not create upload request: %s", err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user