Comments (6)
+1 problem exists. Uploading file adds it to s3
bucket, but deleting file from keystone is not deleting it from s3
bucket.
from keystone-storage-adapter-s3.
For future reference, until this problem is fixed it is best to use a post-hook to delete it manually. Something like this should do the trick:
Image.schema.post('remove', function (doc) {
// Delete the file from the your adapter here.
});
from keystone-storage-adapter-s3.
Yeah, this is very problematic for my current set up.
On remove hook, is all fine, but what if trying to delete an image when editing a post ?
In that case, the updateItem method of FileType is call, and no way of hooking there, so I cant delete my images on S3... :(
from keystone-storage-adapter-s3.
I'm trying to delete a file when it is removed or switched, and not only when the entire document is deleted. I know I can use a pre save hook to get an opportunity to delete the file, but I need the old value. I was thinking that I could get the old value by storing it while in a setter, but this hasn't worked.
Document.schema.path('file.filename').set(function(newVal) {
this._oldFileFilename = this.file.filename;
return newVal;
});
Before I include this setter, it seems that the filename is added on the object as normal, but with the setter it is no longer added. Is my setter perhaps conflicting with one added by this project? (I haven't looked into this yet, I was wondering if anyone else has tried this).
from keystone-storage-adapter-s3.
This is still an issue or am I missing something? I cannot remove images from S3 at all... As mentioned above it removes db entry but does not fire S3Adapter.prototype.removeFile
any suggestions?
from keystone-storage-adapter-s3.
+1
from keystone-storage-adapter-s3.
Related Issues (20)
- No option to use original filename HOT 5
- No support for IAM roles HOT 2
- Multiple images? HOT 4
- Cloudfront support HOT 2
- failure to prefix path with `/` results in leaking local directory info into s3 url HOT 2
- pre:upload option is gone? HOT 1
- schema option to presave image dimensions HOT 1
- Compatibility with latest Keystone version HOT 3
- Note field option
- S3 Multiple Uploads HOT 1
- ACL: "public-read" HOT 9
- Define endpoint to use other s3 compatible object storage HOT 1
- Public URL is incorrectly generated? HOT 1
- uploads added to /tmp on server HOT 1
- Digital Ocean Spaces support? HOT 1
- `encodeSpecialCharacters()` behaviour
- Dynamic path HOT 1
- Original Filename HOT 4
- "Field errors" HOT 13
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 keystone-storage-adapter-s3.