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

[FEAT]: Support for Files Alias Name #1076

Closed
Renc17 opened this issue Jun 14, 2024 · 4 comments
Closed

[FEAT]: Support for Files Alias Name #1076

Renc17 opened this issue Jun 14, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@Renc17
Copy link
Collaborator

Renc17 commented Jun 14, 2024

Suggestion

I propose adding a new feature to the storage module that allows users to specify an alias name for uploaded files. This functionality will enable users to provide a custom name for each file upon upload, addressing potential duplication issues when files with identical names are uploaded.

To achieve this, I propose we use a generated UUID instead of indexing file names for uniqueness.

@Renc17 Renc17 added the enhancement New feature or request label Jun 14, 2024
@kkopanidis
Copy link
Contributor

My thoughts on implementing this are as follows:

  • Make file name optional in file requests. If no name is provided a UUID will be create for file name
  • Introduce a new field for requests and the db, where you can specify the name of the file as you want it to appear, but not as you want it stored.
    Pros:
    Not breaking, allows for better visualization in the client side
    Cons:
    Maybe a bit more complex to understand

Alternatively, we could change the usage of the name field and always use it as an "alias" but not as the way that the file is going to be stored. So files will always be stored with UUIDs, but will appear with the specified name in the db.
Pros:
Straightforward approach in handling
Cons:
Potentially breaking change, cannot identify file if you're exploring the storage filesystem, don't have the option to specify the name in the storage.

Thoughts @Renc17, @ChrisPdgn, @kon14 ?

@ChrisPdgn
Copy link
Contributor

ChrisPdgn commented Jun 17, 2024

Would it be wrong if we added the naming logic that exists in file systems like: "When you download a file that has an already existing name just append a '(1)' to it" ? That way we don't change anything and we just check the count of files that have this name already and add the suffix.

@kkopanidis
Copy link
Contributor

@ChrisPdgn that's another behaviour that we could look into. In general uniqueness is enforced db-wise I think, can't remember precisely. So a file with name X needs to be unique across everything. But even if we consider container/bucket and folder names, this would work nicely. I don't know if it should be the default behaviour though, or if the strategy should be specified on the settings and/or the request to create the file. Meaning to pick between setting (1), (2) etc. for example or use the uuid to store the file and keep the name in the db

@kkopanidis
Copy link
Contributor

done in #1096

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

3 participants