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

Override has disappeared #1073

Open
Papaya-web-solution opened this issue Jul 11, 2023 · 0 comments
Open

Override has disappeared #1073

Papaya-web-solution opened this issue Jul 11, 2023 · 0 comments

Comments

@Papaya-web-solution
Copy link

Hello,
I updated TinyFileManager and noticed that the OverRide option disappeared during an Upload.
I added it in my own version and I took the opportunity to modify its behavior which did not suit me.
Indeed, you rename the new file that we upload while I prefer to rename the existing file before uploading a new file.
So I have a history of modified files and the new version is automatically applied, it seems more logical and easier to use daily
Here is the code I modified:

BEFORE:
if ($chunkIndex == $chunkTotal - 1) { if (file_exists ($fullPath)) { $ext_1 = $ext ? '.'.$ext : ''; $fullPathTarget = $path . '/' . basename($fullPathInput, $ext_1) .'_'. date('ymdHis'). $ext_1; } else { $fullPathTarget = $fullPath; } rename("{$fullPath}.part", $fullPathTarget); }

AFTER:
if ($chunkIndex == $chunkTotal - 1) { if (file_exists($fullPath)) { $ext_1 = $ext ? '.' . $ext : ''; rename($fullPath, $path . '/' . basename($fullPathInput, $ext_1) . '_' . date('ymdHis') . $ext_1); } rename("{$fullPath}.part", $fullPath); }

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

No branches or pull requests

1 participant