diff --git a/local.go b/local.go index 2c4e9c7..deac910 100644 --- a/local.go +++ b/local.go @@ -48,7 +48,7 @@ func (l *localProvider) ListFiles(prefix string) ([]file, error) { } out = append(out, file{ - Filename: strings.TrimLeft(strings.Replace(path, prefix, "", 1), "/"), + Filename: strings.TrimLeft(strings.Replace(path, prefix, "", 1), string(os.PathSeparator)), Size: f.Size(), MD5: fmt.Sprintf("%x", md5.Sum(content)), }) diff --git a/s3.go b/s3.go index 140b2a3..2fac607 100644 --- a/s3.go +++ b/s3.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "mime" + "os" "path/filepath" "regexp" "strings" @@ -32,7 +33,7 @@ func (s *s3Provider) getBucketPath(prefix string) (bucket string, path string, e } bucket = matches[1] - path = matches[2] + path = strings.Replace(matches[2], string(os.PathSeparator), "/", -1) return }