Oct-12-2017, 11:43 PM
Hi,
I'm trying to upload a csv file to Box via Mulesoft API, I can upload the file but only the file with last line, I can not upload full file. I m not even getting error.
Please see the following code.
Thanks
I'm trying to upload a csv file to Box via Mulesoft API, I can upload the file but only the file with last line, I can not upload full file. I m not even getting error.
Please see the following code.
import urllib import requests filePath='C:\\Work\\PNC\\Data\\' fileName= 'CHASE.20171003.csv' headers = {"Content-type": "application/x-www-form-urlencoded", "Accept": "text/plain"} url = 'https://box-esb.cloudhub.io/uploadCHASEFile' fileStream = open(filePath+fileName,'rb') payload = {'Body':fileStream,'Name':fileName} r=requests.post(url = url, headers=headers, data = payload) fileStream.close() print rPlease advice whats wrong in this code.
Thanks