From 64caa155561ab7f15b7e780deab5a5596ab1d06a Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Thu, 5 Nov 2020 16:58:30 +0300 Subject: [PATCH] [#148] Use base name as `FileName` attribute value Signed-off-by: Alex Vanin --- cmd/neofs-cli/modules/object.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/neofs-cli/modules/object.go b/cmd/neofs-cli/modules/object.go index c4a085cc2..7b7a9849d 100644 --- a/cmd/neofs-cli/modules/object.go +++ b/cmd/neofs-cli/modules/object.go @@ -10,6 +10,7 @@ import ( "io/ioutil" "math" "os" + "path/filepath" "strconv" "strings" "time" @@ -494,7 +495,7 @@ func parseObjectAttrs(cmd *cobra.Command) ([]*object.Attribute, error) { disableFilename, _ := cmd.Flags().GetBool("disable-filename") if !disableFilename { - filename := cmd.Flag("file").Value.String() + filename := filepath.Base(cmd.Flag("file").Value.String()) attr := object.NewAttribute() attr.SetKey(object.AttributeFileName) attr.SetValue(filename)