mirror of
https://tvoygit.ru/Djam/abfapi.git
synced 2025-02-23 10:22:45 +00:00
update to >= 1.22.0
This commit is contained in:
parent
747e7cb57f
commit
8a76ee743c
1 changed files with 2 additions and 2 deletions
|
@ -533,12 +533,12 @@ func (a *AbfJson) UploadFile(filePath string, silent bool) (string, error) {
|
||||||
body := &bytes.Buffer{}
|
body := &bytes.Buffer{}
|
||||||
writer := multipart.NewWriter(body)
|
writer := multipart.NewWriter(body)
|
||||||
|
|
||||||
part, err := writer.CreateFormFile("file_store[file]", filePath)
|
part, err := writer.CreateFormFile("file_store[file]", filepath.Base(filePath))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err = os.Open(filePath)
|
file, err := os.Open(filePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue