mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
Merge pull request #810 from chenall/master
fix ghttp_client upload filename issue #809
This commit is contained in:
@ -135,7 +135,7 @@ func (c *Client) DoRequest(method, url string, data ...interface{}) (resp *Clien
|
||||
if !gfile.Exists(path) {
|
||||
return nil, errors.New(fmt.Sprintf(`"%s" does not exist`, path))
|
||||
}
|
||||
if file, err := writer.CreateFormFile(array[0], path); err == nil {
|
||||
if file, err := writer.CreateFormFile(array[0], gfile.Basename(path)); err == nil {
|
||||
if f, err := os.Open(path); err == nil {
|
||||
if _, err = io.Copy(file, f); err != nil {
|
||||
f.Close()
|
||||
|
||||
Reference in New Issue
Block a user