Comments (2)
Can you create a fork with this in it, as well as the relevant tests? Thanks!
from cakephp-upload.
A note on why this was implemented my way and not quite the same as you.
Lets say for record 5, I upload a file named bob.jpg
. Sometime later, I update the record with a different file, also named bob.jpg
.
In your case, code, and if deleteOnUpdate
is set to true in mine, the file bob.jpg
is added to the deletion cue, the new file is uploaded, and then in the afterSave, the old file, bob.jpg
, is deleted right at the end. That means we essentially did not upload a file.
Rather than rework this to use a complicated set of file renames that might potentially fail, I would rather let the developer decide what the tradeoffs be of allowing such a thing to occur. In the future, appending/prepending some hash to the filename, or even allowing the files to be renamed on the fly, may allow for this particular issue to be mitigated. Until then, I decided that implementing this in such a way as to not delete old files by default was the best way.
Please reopen if this is not satisfactory to your work, or if you have a better solution.
from cakephp-upload.
Related Issues (20)
- Cannot use object of type Laminas\Diactoros\UploadedFile as array HOT 1
- Error when I delete two or more files at the same folder HOT 1
- league/flysystem package constraint HOT 1
- Error when installing on CakePHP 4.1.6 HOT 1
- CakePHP 4 Upload Plugin
- set behaviors config in Method results in emtpy filename
- Cannot Find plugin and it is there HOT 1
- Save on _joinData HOT 2
- request to new tag on 3.x HOT 2
- Test Fixtures have type `upload.file` for upload field. HOT 4
- Class 'League\Flysystem\Adapter\Local' not found HOT 2
- Saving model failed with no error HOT 1
- Duplicate configs on certain situations HOT 2
- Deprecated
- Solved: Using transformer does not upload video and entity isn't saved HOT 1
- File not uploading/object not removed from data HOT 2
- Unable to upload images to S3 HOT 1
- 700 permission in subfolder using 'path' HOT 1
- Support for chunking HOT 1
- cake-5 branch not installable HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cakephp-upload.