forked from TrueCloudLab/frostfs-node
[#148] Use base name as FileName
attribute value
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
54818d5a11
commit
64caa15556
1 changed files with 2 additions and 1 deletions
|
@ -10,6 +10,7 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"math"
|
"math"
|
||||||
"os"
|
"os"
|
||||||
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
@ -494,7 +495,7 @@ func parseObjectAttrs(cmd *cobra.Command) ([]*object.Attribute, error) {
|
||||||
|
|
||||||
disableFilename, _ := cmd.Flags().GetBool("disable-filename")
|
disableFilename, _ := cmd.Flags().GetBool("disable-filename")
|
||||||
if !disableFilename {
|
if !disableFilename {
|
||||||
filename := cmd.Flag("file").Value.String()
|
filename := filepath.Base(cmd.Flag("file").Value.String())
|
||||||
attr := object.NewAttribute()
|
attr := object.NewAttribute()
|
||||||
attr.SetKey(object.AttributeFileName)
|
attr.SetKey(object.AttributeFileName)
|
||||||
attr.SetValue(filename)
|
attr.SetValue(filename)
|
||||||
|
|
Loading…
Reference in a new issue