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

file overwritten if same name #22

Open
s-renier-taonix-fr opened this issue Sep 19, 2022 · 4 comments
Open

file overwritten if same name #22

s-renier-taonix-fr opened this issue Sep 19, 2022 · 4 comments
Labels

Comments

@s-renier-taonix-fr
Copy link

Hi!

Is it possible to have an option so that a file is not overwritten when uploading a file with an existing name?
Ideally, the new file should be named automatically with a suffix like "_copy" or the current datetime.

@xdan
Copy link
Owner

xdan commented Dec 1, 2022

Hi, added option in config

  • $config['saveSameFileNameStrategy'] = "addNumber" - Strategy in case the uploaded file has the same name as the file
    on the server.
    • "addNumber" - The number "olsen.png" => "olsen(1).png" is added number to the file name, if such a file exists, it
      will be "olsen(2).png", etc.
    • "replace" - Just replace the file
    • "error" - Throw the error - "File already exists"

@xdan xdan added the wip label Dec 1, 2022
@s-renier-taonix-fr
Copy link
Author

It doesn't work.
In fact, I can't find any occurrence of "saveSameFileNameStrategy" in the code except in the "Readme"

@xdan
Copy link
Owner

xdan commented Dec 2, 2022

This repository contains only the code that deploys the application to your backend; all logic is in its deps in jodit/application https://github.com/xdan/jodit-connector-application package, just update it

composer upgrade jodit/application

@s-renier-taonix-fr
Copy link
Author

Yes I know.

But I figured out the problem now:
The docker image used in this project is "chialab/php:7.2-fpm".
This release contains a version of "composer" which only installs version "3.0.33" of the "jodit-application" dependency.

I went to the "chialab/php:8.0-fpm" image and it's ok now, the "saveSameFileNameStrategy" configuration option is taken into account.
And I find many occurrences of this option in "jodit-application".

Thank you for your help.
You can archive this message.

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

No branches or pull requests

2 participants