import: avoid ugly padding = at the end of base32 pathname

This commit is contained in:
nemunaire 2017-11-24 19:34:14 +01:00
parent 21590655cb
commit 9325419002

View File

@ -89,7 +89,7 @@ func importFile(uf uploadedFile, next func(string, string, []byte) (interface{},
return nil, errors.New("URI or path not filled")
}
pathname := path.Join(fic.FilesDir, strings.ToLower(base32.StdEncoding.EncodeToString(hash[:])), path.Base(fromURI))
pathname := path.Join(fic.FilesDir, strings.ToLower(base32.StdEncoding.WithPadding(0).EncodeToString(hash[:])), path.Base(fromURI))
// Remove the file if it exists
// TODO: check if this is symlink => remove to avoid File not found error after, because the file is writen at the adresse pointed.