Browse Source

ensure file name does not contain any "/"

pull/2/head
Chris Lu 12 years ago
parent
commit
0b7a235c17
  1. 2
      weed-fs/src/pkg/storage/needle.go

2
weed-fs/src/pkg/storage/needle.go

@ -6,6 +6,7 @@ import (
"io/ioutil"
"mime"
"net/http"
"path"
"pkg/util"
"strconv"
"strings"
@ -50,6 +51,7 @@ func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {
return
}
fname = part.FileName()
fname = path.Base(fname)
data, _ := ioutil.ReadAll(part)
dotIndex := strings.LastIndex(fname, ".")
ext, mtype := "", ""

Loading…
Cancel
Save