Salesforce Bulk API file insert

we want to insert files/attachments in salesforce using Bulk Api.
we have files from legacy system that we are getting in a sftp folder. All these files paths, along with parent references like case and contact external ids, we have in a csv. Now we want to insert these files into salesforce in batches. How do we do that?