Use href instead of displayname for Name()
This commit is contained in:
parent
fa9482a9f2
commit
33816041d6
@ -6,7 +6,9 @@ import (
|
||||
"encoding/xml"
|
||||
"io"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
pathpkg "path"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
@ -84,7 +86,11 @@ func (c *Client) ReadDir(path string) ([]os.FileInfo, error) {
|
||||
|
||||
if p := getProps(r, "200"); p != nil {
|
||||
f := new(File)
|
||||
if ps, err := url.QueryUnescape(r.Href); err == nil {
|
||||
f.name = pathpkg.Base(ps)
|
||||
} else {
|
||||
f.name = p.Name
|
||||
}
|
||||
f.path = path + f.name
|
||||
|
||||
if p.Type.Local == "collection" {
|
||||
|
Loading…
Reference in New Issue
Block a user