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

Single file preserve filename in ipfs kubo download in same directory #520

Open
ofman opened this issue Dec 7, 2023 · 2 comments
Open
Labels
need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization

Comments

@ofman
Copy link

ofman commented Dec 7, 2023

If you want to preserve filename in ipfs kubo there is a suggestion in docs and forums to wrap a folder around the file as a workaround but when you want to save a single file in the same directory you get "ErrPathEistsOverwrite" error ("path already exists and overwriting is not allowed") because in github.com/ipfs/boxo@v0.15.0/files/filewriter.go file 38 line there is os.Mkdir(fpath, 0o777) function. Can you fix this either by letting single file case preserve filenames in ipfs or by not calling os.Mkdir if there is only 1 file in directory please? Thanks!

@ofman ofman added the need/triage Needs initial labeling and prioritization label Dec 7, 2023
@lidel
Copy link
Member

lidel commented Dec 11, 2023

@ofman thank you for reporting, but it is a bit unclear what is the problem.
Do you mind providing a code snippet that reproduces the issue?

@ipfs ipfs deleted a comment from welcome bot Dec 11, 2023
@lidel lidel added the need/author-input Needs input from the original author label Dec 11, 2023
@ofman
Copy link
Author

ofman commented Dec 13, 2023

@ofman thank you for reporting, but it is a bit unclear what is the problem. Do you mind providing a code snippet that reproduces the issue?

@lidel I have created whole new repository just for ya! :)
Here it is: https://github.com/ofman/filesharegocli
Just go build and do basic usage steps then change shouldWorkButNot := false to shouldWorkButNot := true and you will see the error after go build and basic usage steps.

Basic usage in README.md and below:
Use flags -f "example.jpg" or -c "exampleCid" to share files for example:
Upload file (keep terminal window open/running to let others download):
./fsg -f go.sum
Download file (open new terminal window):
./fsg -c /ipfs/QmX4zdEUtimXgxhpzv8jfFLqkuutNhmoNH987cH5RS67GM

P.S. Also see same issue for other brogrammer here: #28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need/author-input Needs input from the original author need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

2 participants