Do you want to upload files programmatically? As a workaround ,I recommend you use Power Automate to create a workflow to achieve the functionality you need. You can following these steps:
- Choose 'When a file is created or modified (properties only)' ->> input Site Address and Library Name
- Choose 'Update file properties' (As shown in the screenshot)

- Click Save and the filename will be filled automatically to the "DocTitle" (Note: When you click "Upload" and upload the file, you may need to wait a few minutes and then refresh the list, the "DocTitle" will be automatically filled)
4.Create "DocYear" column and use Calculated Field with following formula: =CONCATENATE(YEAR(Created)),then the column "DocYear" will be filled with the current year
Go to Library Setting >> Create Column

My test result:

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.