1. Enable Allow site guest users to upload files in Salesforce Files General Settings.
2. Go to Community Preferences and update Maximum file size and file types.
3. Create a custom lightning component using lightning:fileUpload tag.
Sample code – https://www.infallibletechie.com/2018/03/sample-code-component.html
4. Make sure the component implements forceCommunity:availableForAllPageTypes. Add the custom lightning component to the community page.