adding exception handling for this case

This commit is contained in:
Chris Lu 2012-11-20 00:42:45 -08:00
parent f5a8382933
commit 084e0ab7bb

View file

@ -32,7 +32,12 @@ func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {
e = fe
return
}
part, _ := form.NextPart()
part, fe := form.NextPart()
if fe != nil {
fmt.Println("Reading Multi part [ERROR]", fe)
e = fe
return
}
fname = part.FileName()
data, _ := ioutil.ReadAll(part)
//log.Println("uploading file " + part.FileName())