this is the WPDM plugin / s3 module. The system works perfectly for new packages or for newly added files. they are transferred to S3 and links are working. The issue is with pre-existing files that were added to packages before using the S3 plugin.
The manual solution is to go into each package and select the file from S3 and delete the old package. However, there are thousands of files. There must be a better solution to this.
When a file is synced to S3 using https://domain.com/?s3sync=1 that file is sent to S3 and the package shows in the Attached files section that the URL is updated to https://domain.s3.amazon.com/downloads/file.pdf.
So the s3sync=1 is doing what it is supposed to do – upload the pre-existing file to S3, update the download link for the file in the package. However, if the pre-existing file has a space in it then the link is broken due to double encoding.