|
@ -3,7 +3,6 @@ package storage |
|
|
import ( |
|
|
import ( |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/glog" |
|
|
"github.com/chrislusf/seaweedfs/weed/operation" |
|
|
"github.com/chrislusf/seaweedfs/weed/operation" |
|
|
"io" |
|
|
|
|
|
"io/ioutil" |
|
|
"io/ioutil" |
|
|
"mime" |
|
|
"mime" |
|
|
"net/http" |
|
|
"net/http" |
|
@ -14,12 +13,6 @@ import ( |
|
|
|
|
|
|
|
|
func parseMultipart(r *http.Request) ( |
|
|
func parseMultipart(r *http.Request) ( |
|
|
fileName string, data []byte, mimeType string, isGzipped bool, originalDataSize int, isChunkedFile bool, e error) { |
|
|
fileName string, data []byte, mimeType string, isGzipped bool, originalDataSize int, isChunkedFile bool, e error) { |
|
|
defer func() { |
|
|
|
|
|
if e != nil && r.Body != nil { |
|
|
|
|
|
io.Copy(ioutil.Discard, r.Body) |
|
|
|
|
|
r.Body.Close() |
|
|
|
|
|
} |
|
|
|
|
|
}() |
|
|
|
|
|
form, fe := r.MultipartReader() |
|
|
form, fe := r.MultipartReader() |
|
|
if fe != nil { |
|
|
if fe != nil { |
|
|
glog.V(0).Infoln("MultipartReader [ERROR]", fe) |
|
|
glog.V(0).Infoln("MultipartReader [ERROR]", fe) |
|
|