Is there a way to use a token like
[file:fid] when using the file upload field? I either want to use this, or, use the node id it is attached to with
[node:nid]. It looks like I can only use global tokens, which are not unique enough to the way I want to store the file on the server.
In core this is not possible, because the file widget sets the #upload_location when it builds the form element.
You need a module, for example File (Field) Paths. This module sets a temp path in #upload_location of the form element and sorts this out later when the file and node entity are available.