Hi Ervinnnn,
welcome to the Apple (user-to-user) Community!
Re: "I lost all my files when i did the iOS 17 update: why did it happen now"
We are Apple users, just like yourself, in the community, so have no access to your iPhone to check why.
Seems you may not have had enough storage space on your iPhone for the update, for the iPhone to do its work, and for those files. An iPhone comes with a set amount of storage space, and files can fill it up.
Eg: An iPhone generally needs around 8Gb free space in which to operate smoothly at all times.
How to check the storage on your iPhone and iPad - Apple Support
If storage is a problem: the first step would likely be to carefully back-up all your remaining files.
How to back up your iPhone, iPad, and iPod touch - Apple Support so files can be restored if needed.
Then to free up more space: "Manage space on your iPhone in the article below for tips:
See: If you need more space for an update on your iPhone, iPad, or iPod touch - Apple Support
___________________
Re: "i want them back"
If files were deleted to make enough space to complete the update, seems files you can redownload would go.
If you have enough space for the files that are missing you can likely re-download them all:
Eg: Redownload apps and games from Apple - Apple Support
Redownload books and audiobooks - Apple Support
Redownload TV shows and movies that you purchased - Apple Support
Redownload music - Apple Support
You can also recover recently deleted email, photos, notes, and voice memos.
https://support.apple.com/guide/iphone/restore-purchased-and-deleted-items-iphfe205f2e5/ios:
Hope this helps :-)