report errors when upload timeouts

This commit is contained in:
Chris Lu
2013-08-05 13:37:41 -07:00
parent e94d52c1af
commit 54906c48f3
2 changed files with 29 additions and 25 deletions

View File

@@ -60,7 +60,12 @@ func NewNeedle(r *http.Request) (n *Needle, e error) {
e = errors.New("No file found!")
return
}
data, _ := ioutil.ReadAll(part)
data, ioe := ioutil.ReadAll(part)
if ioe != nil {
e = ioe
log.Println("Reading Content [ERROR]", ioe)
return
}
dotIndex := strings.LastIndex(fname, ".")
ext, mtype := "", ""
if dotIndex > 0 {