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 · 4 comments
Open
Assignees
Labels
dif/medium Prior experience is likely helpful effort/hours Estimated to take one or several hours kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now

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/[email protected]/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

@lidel lidel removed the need/author-input Needs input from the original author label Jun 25, 2024
@gammazero gammazero added the P2 Medium: Good to have, but can wait until someone steps up label Aug 20, 2024
@gammazero gammazero self-assigned this Aug 20, 2024
@gammazero gammazero removed the need/triage Needs initial labeling and prioritization label Aug 20, 2024
@gammazero
Copy link
Contributor

@ofman It seems that what is needed is to add a "force-overwrite" flag to allow downloaded file(s) to replace any existing. Would that be a sufficient solution to this issue?

@lidel lidel added the need/author-input Needs input from the original author label Aug 21, 2024
Copy link

Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.

@lidel lidel added dif/medium Prior experience is likely helpful effort/hours Estimated to take one or several hours kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now and removed kind/stale need/author-input Needs input from the original author P2 Medium: Good to have, but can wait until someone steps up labels Sep 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dif/medium Prior experience is likely helpful effort/hours Estimated to take one or several hours kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now
Projects
None yet
Development

No branches or pull requests

3 participants