Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

上传文件夹和会导致出错的问题 #48

Open
Pandaft opened this issue Nov 18, 2021 · 1 comment
Open

上传文件夹和会导致出错的问题 #48

Pandaft opened this issue Nov 18, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Pandaft
Copy link

Pandaft commented Nov 18, 2021

目前带 -s 上传某个目录时,会将里面的所有文件都上传到传输里,而文件夹则不会保留,例如:

./root.zip
./folder-a/a.zip
./folder-b/b.zip

在上传后,打开传输链接后展示的结构是:

./root.zip
./a.zip
./b.zip

对于一些需要分类的文件和文件夹来说会有很大的麻烦。

并且里面如果有相同文件名的文件会出错,例如:

./file.zip
./folder/file.zip

这时如果上传,在碰到重复的名字时会报错:

Destination: https://******.cowtransfer.com/s/****************
Local: test\file.zip
913.03 KiB / 913.03 KiB [------------------------------------------------------------------] 100.00% 7.44 MiB p/s 300ms
Local: test\folder\file.zip
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x0 pc=0xacf414]

goroutine 1 [running]:
main.getUploadConfig(0xbe9f40, 0xc000162230, 0xc0000ac000, 0xc000162230, 0x0, 0x0)
        /home/runner/work/cowtransfer-uploader/cowtransfer-uploader/uploader.go:410 +0x4b4
main._upload(0xc0000a6730, 0xe, 0xc0000ac000, 0xc0000a6730, 0xe)
        /home/runner/work/cowtransfer-uploader/cowtransfer-uploader/uploader.go:145 +0x1d7
main.upload.func3(0xc0000a6730, 0xe, 0xbe9f40, 0xc0001621c0, 0x0, 0x0, 0xe, 0x0)
        /home/runner/work/cowtransfer-uploader/cowtransfer-uploader/uploader.go:116 +0x18e
path/filepath.walk(0xc0000a6730, 0xe, 0xbe9f40, 0xc0001621c0, 0xc000819ce8, 0x0, 0x0)
        /opt/hostedtoolcache/go/1.15.15/x64/src/path/filepath/path.go:360 +0x443
path/filepath.walk(0xc0000a66cc, 0x3, 0xbe9f40, 0xc000162070, 0xc000819ce8, 0x0, 0x0)
        /opt/hostedtoolcache/go/1.15.15/x64/src/path/filepath/path.go:384 +0x31a
path/filepath.walk(0xc00000a138, 0x4, 0xbe9f40, 0xc0000c8070, 0xc000819ce8, 0x0, 0x0)
        /opt/hostedtoolcache/go/1.15.15/x64/src/path/filepath/path.go:384 +0x31a
path/filepath.Walk(0xc00000a138, 0x4, 0xc00011dce8, 0x10, 0xc00011dd28)
        /opt/hostedtoolcache/go/1.15.15/x64/src/path/filepath/path.go:406 +0x10c
main.upload(0xc000050e40, 0x1, 0x1)
        /home/runner/work/cowtransfer-uploader/cowtransfer-uploader/uploader.go:108 +0x338
main.main()
        /home/runner/work/cowtransfer-uploader/cowtransfer-uploader/main.go:83 +0x32b

我目前的解决方法就是先打包压缩再上传,但是打包后就不能只挑选其中的几个文件再下载了(例如上传教程视频,接收者可能只需要其中的几个视频,打包后只能全部下载)

@Mikubill Mikubill added the enhancement New feature or request label Nov 18, 2021
@Mikubill
Copy link
Owner

问题确认。这个需要在上传流程中做一点调整

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants