Kindly note that we mainly focus on general usage questions about Microsoft Teams, since your question may be more related to development, I have added the related tags for better support.
If you are looking for Microsoft solution on this question, to me you may consider using Graph Api to develop an application or scripts to upload files to the corresponding Sharepoint sites to achieve this goal.
Here are some documentations which may be helpful:
Upload or replace the contents of a DriveItem
driveItem: createUploadSession
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.