diff --git a/net/ghttp/ghttp_client_request.go b/net/ghttp/ghttp_client_request.go index eb6e6d78b..45c84c2b7 100644 --- a/net/ghttp/ghttp_client_request.go +++ b/net/ghttp/ghttp_client_request.go @@ -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()