Hello @frob
There are several reasons why you may be unable to delete a file. Try each of these until you find one that resolves your issue.
- Ensure the item is not checked out by another user.
- Always make sure you have the appropriate permissions to delete the item or have a site collection administrator attempt to remove the item.
- Retention policies can cause this. You might have to either disable or exclude the respective hold policy that's causing the issue. After a retention policy or hold is removed, it may take up to 24 hours for the change to take effect. Ensure that there is not a retention policy set up on the item.
- The site might have exceeded its storage limit. Increase the site quota and delete the item.
- Administrators can use SharePoint Patterns and Practices (PnP), which contains a library of PowerShell commands that allows you to perform complex management actions such as force the deletion of items you cannot otherwise delete.
You can store up to 30 million items or files in a list or library. Filtered views of large lists have a similar experience to other lists. However, when a list view shows more than 5000 items, you may run into a list view threshold error.
In order to manage large lists and libraries do follow the below link,
https://support.microsoft.com/en-us/office/manage-large-lists-and-libraries-b8588dae-9387-48c2-9248-c24122f07c59
Hope this answers all your queries, if not please do repost back.
If an Answer is helpful, please click "Accept Answer" and upvote it : )
Regards,