I have to post a file along with some data to to api. Here is the python code i wrote for testing:
fl={'payload' : open('C:/data/log2.txt')}
params = {
'topic':'pos',
'store':storeID,
}
r = requests.post(url,files=fl,data=params)
print r.status
print r.text
But i always get a message saying, "file is not in correct format"
I tested the api with POSTMAN (chrome extension to test rest API) and it seems to work fine with postman i get a success response and the file is sent, here is a snapshot.

amazonlog.logandlog2.txt. Make sure that the file in your code is sent with the same name and has the same contents asamazonlog.log. Maybe you need a.logextension...?