heroku / salesforce-bulk

Python interface to the Salesforce.com Bulk API
MIT License
207 stars 154 forks source link

Add support for binary data uploads #71

Open ari-luokkala opened 5 years ago

ari-luokkala commented 5 years ago

With this change it is possible to upload binary data with post, e.g. binary file attachments. It is up to consumer to generate the binary content and then post it with compatible Content-Type, e.g. ZIP/CSV.

E.g. job = bulk.create_insert_job("Account", contentType='ZIP_CSV') binary_data = open('request.zip', 'rb').read() batch = bulk.post_batch(job, binary _data)

Reference: https://developer.salesforce.com/docs/atlas.en-us.api_asynch.meta/api_asynch/binary_intro.htm