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 }) |