Suppose that a person creates a website where the users can upload text (eBooks). There is no obvious way to be sure that users own the copyright to text that they upload. Assume that the website is designed so that after the user uploads the eBook the owner must approve the texts before they are displayed on the website. What does the law require the owner to do to avoid copyright infringement claims.
The law requires that the website operator be correct that no infringing material is available on the website. You are correct that it's not possible to be certain that a person has the right to upload a document, therefore there is always some risk of being sued for contributory infringement. DMCA in the US is one means of protecting "repository" sites, such as Youtube, Zenodo and (in principle) Libgen from getting sued because some user uploaded pirated content. However the provisions of the DMCA safe harbor requires parties to adhere to strict procedural rules, and the website operator must have "clean hands", which basically means that they do not know that uploaded material is pirated and they don't select material (upload must be automatic). The following condition must be observed
the transmission, routing, provision of connections, or storage is carried out through an automatic technical process without selection of the material by the service provider
By subjective content to approval, the DMCA safe harbor is unavailable.