By marcusrosin
followed documentation, link : https://docs.digitalocean.com/products/spaces/resources/s3-sdk-examples/#delete-a-file-from-a-space
Spaces region is FRA1 (frankfurt, germany)
using NodeJS backend (express + ubuntu OS), got success response in console but file is not deleted in spaces.
success response :
Success { ‘$metadata’: { httpStatusCode: 204, requestId: undefined, extendedRequestId: undefined, cfId: undefined, attempts: 1, totalRetryDelay: 0 }, DeleteMarker: undefined, RequestCharged: undefined, VersionId: undefined }
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
It sounds like you might have CDN enabled.
If this is the case, then you would need to purge your CDN cache if you want the deleted files to be purged from the CDN cache directly:
https://docs.digitalocean.com/products/spaces/how-to/manage-cdn-cache/
Let me know how it goes.
Best,
Bobby
Hello, I use the go AWS s3 sdk to manage the spaces.
When i try to use the WithContex… version of delete method, I’m getting the error “Not Implemented”:
if _, err := c.s3.DeleteObjectsWithContext(ctx, &s3.DeleteObjectsInput{
Bucket: aws.String(c.bucket),
Delete: &s3.Delete{
Objects: []*s3.ObjectIdentifier{{
Key: aws.String(path),
}},
},
}); err != nil {
return err // <-- not implemented here
}
But version without context does not return error and object got deleted (I can confirm it looking to the web interface if the Spaces). However the method does not return error even if I’m trying to delete not existing object:
if _, err := c.s3.DeleteObject(&s3.DeleteObjectInput{
Bucket: aws.String(c.bucket),
Key: aws.String(path),
}); err != nil {
return err //<-- always nil and object deleted
}
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.