mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
checking file name empty
This commit is contained in:
parent
a4cef2fbd4
commit
bd278337db
|
@ -1,13 +1,14 @@
|
|||
package storage
|
||||
|
||||
import (
|
||||
"code.google.com/p/weed-fs/go/util"
|
||||
"encoding/hex"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"mime"
|
||||
"net/http"
|
||||
"path"
|
||||
"code.google.com/p/weed-fs/go/util"
|
||||
"strconv"
|
||||
"strings"
|
||||
)
|
||||
|
@ -51,7 +52,12 @@ func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {
|
|||
return
|
||||
}
|
||||
fname = part.FileName()
|
||||
fname = path.Base(fname)
|
||||
if fname != "" {
|
||||
fname = path.Base(part.FileName())
|
||||
} else {
|
||||
e = errors.New("No file found!")
|
||||
return
|
||||
}
|
||||
data, _ := ioutil.ReadAll(part)
|
||||
dotIndex := strings.LastIndex(fname, ".")
|
||||
ext, mtype := "", ""
|
||||
|
|
Loading…
Reference in a new issue