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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰 [BUG] - 2 files with same name #104

Closed
ThomasSed opened this issue Oct 14, 2022 · 8 comments 路 Fixed by #106
Closed

馃悰 [BUG] - 2 files with same name #104

ThomasSed opened this issue Oct 14, 2022 · 8 comments 路 Fixed by #106
Labels
bug Something isn't working

Comments

@ThomasSed
Copy link

Description

when uploading files, if you are uploading a file (same one or an other one) with the same name, it'll be stored.
The user must be advertised and specify his intention

Reproduction URL

https://github.com/ThomasSed/Storz

Reproduction steps

1. Go to "home"
2. Click on "upload"
3. upload a file
4. do the 3 first steps a second time, with the same file (for example) 
5. go to your repository, you must see 2 files with same name

Screenshots

![DESCRIPTION](LINK.png)

Logs

No response

Browsers

No response

OS

No response

@ThomasSed ThomasSed added the bug Something isn't working label Oct 14, 2022
@anomic30
Copy link
Owner

Hi, @ThomasSed,
If a user uploads the same file even with different file names, it will generate the same CID. So we can check if that CID already exists in the user's document and we can show him some message like:

"This file already exists with the name ABC. Do you want to upload the same file again?"

Now, we have to find a way to generate the CID without uploading it to IPFS first.

@mani-rsg
Copy link
Contributor

Would like to work on this. Can you assign this to me? @anomic30

@anomic30
Copy link
Owner

Hi @mani-rsg,
We are not assigning issues to anyone. Only the first PR related to the issue will be considered.

@mani-rsg
Copy link
Contributor

Oh ok sure Then will this count on Hactoberfest ?

@anomic30
Copy link
Owner

@mani-rsg yes

@mani-rsg
Copy link
Contributor

Hi @anomic30, instead of looking for how to generate the CID that is generated after the upload. My suggestion is

  1. To filter for same name, if we found one, we can say like "A file with the same name already exists, do you want to override it?" If yes we will upload & override, else we don't upload.

  2. To perform the delete operation using the unique _id which is by default generated by MongoDB. By doing this, the exact item at which the delete is performed will be deleted.

Let me know if this works. I have done the local setup, based on your confirmation I will start working on this. Thanks

@mani-rsg
Copy link
Contributor

@anomic30 Can you please confirm, if I can go with this approach?

@anomic30
Copy link
Owner

@mani-rsg, yes you can start working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants