Turn on unknown sources in Settings
Open Settings → Apps → Special app access → Install unknown apps. Pick the app you'll use to open the file (usually Chrome, Files or File Manager), then turn on "Allow from this source". From Android 8.0 onward, this permission is granted per app, not for the whole phone. You'll be asked again if you open the file from a different app, so it's best to switch it off once you're done.