Commit de43ad61 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

add -w improvement: wrap multiple files in one dir

  > ipfs add a b c
  added Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 a
  added QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM b
  added QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 c
  added QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3

  > ipfs ls QmXg3WHLcjnz4ejeYF6FKVBkb4m1oKjQmF5fEWL9M1uQF3
  Qmbvkmk9LFsGneteXk3G7YLqtLVME566ho6ibaQZZVHaC9 10 a
  QmR9pC5uCF3UExca8RSrCVL8eKv7nHMpATzbEQkAHpXmVM 10 b
  QmetGxZTgo8tYAKQH1KLsY13MxqeVHbxYVmvzBzJAKU6Z7 10 c

License: MIT
Signed-off-by: default avatarJuan Batiz-Benet <juan@benet.ai>
parent e6f4b474
...@@ -68,6 +68,10 @@ func (f *MultipartFile) NextFile() (File, error) { ...@@ -68,6 +68,10 @@ func (f *MultipartFile) NextFile() (File, error) {
} }
func (f *MultipartFile) FileName() string { func (f *MultipartFile) FileName() string {
if f == nil || f.Part == nil {
return ""
}
filename, err := url.QueryUnescape(f.Part.FileName()) filename, err := url.QueryUnescape(f.Part.FileName())
if err != nil { if err != nil {
// if there is a unescape error, just treat the name as unescaped // if there is a unescape error, just treat the name as unescaped
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment