Both
In fact, in most cases, file transfer is done by FTP/SFTP protocol
(or something http/https can do)
Client sets up to receive file and Server sets up the send file
you can e view it as a water stream. Server is responsible for providing water stream to client and Client is responsible to receive the water stream and collect the water they need