mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
Fix the first form multi-part item is not a "file type part" problem in "ParseUpload()"
This commit is contained in:
parent
9601880e32
commit
7481b7376d
|
@ -60,11 +60,20 @@ func ParseUpload(r *http.Request) (fileName string, data []byte, mimeType string
|
|||
return
|
||||
}
|
||||
part, fe := form.NextPart()
|
||||
if fe != nil {
|
||||
glog.V(0).Infoln("Reading Multi part [ERROR]", fe)
|
||||
e = fe
|
||||
return
|
||||
for {
|
||||
if fe != nil {
|
||||
glog.V(0).Infoln("Reading Multi part [ERROR]", fe)
|
||||
e = fe
|
||||
return
|
||||
}
|
||||
|
||||
if part.FileName() != "" {
|
||||
break //found the first <file type> multi-part
|
||||
}
|
||||
|
||||
part, fe = form.NextPart()
|
||||
}
|
||||
|
||||
fileName = part.FileName()
|
||||
if fileName != "" {
|
||||
fileName = path.Base(fileName)
|
||||
|
|
Loading…
Reference in a new issue