The file is encrypted locally before uploading to the network. Then the file is sharded, and the shards are replicated among the nodes. Once a shard falls below a certain replication threshold, it will get copied to a new node.
There are other schemes that don't require a copy of each shard, allowing you to reconstruct the file if any subset of the nodes is online.