Closed ricardoperezMTVH closed 1 year ago
@ricardoperezMTVH How do you check if the file isn't actually deleted? I tested the feature on the latest uploadcare-ruby version 4.3.1, and it works fine:
file_to_upload = File.open('test.png')
uc_file = Uploadcare::Uploader.upload(file_to_upload)
puts Uploadcare::File.info(uc_file.uuid).datetime_removed # => blank
Uploadcare::File.delete(uc_file.uuid)
puts Uploadcare::File.info(uc_file.uuid).datetime_removed # => 2023-03-20T18:48:29.416021Z
You can also run the test Rails project on your local env and try to click the "Delete" button there, it works well for me.
@kraft001 I've tested that accessing directly the file on the CDN and listing the from the group. I haven't double checked that since the upgrade to the new version.
@ricardoperezMTVH Yes, the file is cached and the CDN copy can be accessed for some time after the main file is removed. If you want to remove the CDN cached copy as well, then it looks like a feature request
@ricardoperezMTVH How do you check if the file isn't actually deleted? I tested the feature on the latest uploadcare-ruby version 4.3.1, and it works fine:
file_to_upload = File.open('test.png') uc_file = Uploadcare::Uploader.upload(file_to_upload) puts Uploadcare::File.info(uc_file.uuid).datetime_removed # => blank Uploadcare::File.delete(uc_file.uuid) puts Uploadcare::File.info(uc_file.uuid).datetime_removed # => 2023-03-20T18:48:29.416021Z
You can also run the test Rails project on your local env and try to click the "Delete" button there, it works well for me.
So, the image I'm deleting belongs to a group. To delele the image I use the delete Uploadcare::File.delete(image_identifier)
but the image is still listed when I call Uploadcare::Group.group_info(group_identifier)
. (edit.: Ok, Now I can see when the image is listed in the group info the "datetime_removed"
is now updated)
@ricardoperezMTVH hi. Right now we don't have cache invalidation feature that you can trigger via API. But we can set up a custom cache length for a project. Email us at help@uploadcare.com and mention this conversation to discuss it with my teammates.
Describe the bug
Uploadcare::File#delete
is not deleting the file.Using the doc reference
Newly updated images
Environment