First, the OSI model has different layers than TCP/IP model; TCP/IP model has just four layers, that is:
- application layer (this is your application)
- transport layer (this is where TCP or UDP comes to play, that's where you need port number)
- internet layer (this is where IP comes to play, that's where you need IP address)
- link layer (I imagine this as "the cables", but it is probably wrong)
The way I wrote it, every layer uses the layer "below" it to do its tasks.
Now, the concept of "files" is only in application layer. Application sends the file using TCP segments - but the segments themselves don't "know" the rest of the file. The TCP layer then uses IP packets to get to the other computer. And the IP packets need to go to the target computer somehow, so that's where you use Ethernet.
However, the lower layers don't really know they are sending "a file", they are just sending some data; what exactly are those data is up to the application layer.
I hope I was clear (and correct)