Bulk Delete scripts for Aliyun OSS object

Source: Internet
Author: User
Tags aliyun

Friends who have used Aliyun OSS services know that if a bucket is not empty underneath, that is, object, then this bucket is not allowed to be deleted. So for bucket with very little object, you can delete them manually. So how do you quickly bulk delete the files and folders that are bucket with lots of object?

I wrote a piece of Javascript code, and in the console of the developer tool, I could do it:

  code is as follows copy code
function A (b,c , d) {
 $.post (' Http://oss.console.aliyun.com/console/portalObject/delete_objects.json ', {
    ' Bucketname ': C,
   ' location ': D,
   ' objects ': B,
   ' Sectoken ': Window. Aliyun_oss_console_config. Sec_token
 }, function (data) {
  console.log (data)
 }, ' json ');
}
$ (' A.ng-scope '). each (function (k) {
 var o = $ (this). text ();
 a (o, ' your_bucket_name ', ' Your_oss_ Location ')//Note this is replaced by your own bucket name and OSS server location, such as Beijing
})

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.