2

I have problem while trying to send big file via requests.toolbelt in python2. I need to send to server filename + filedata + mimetype

My upload "command" looks like this:

file = MultipartEncoder({'files[]': (filename, filedata, mimetype)})
UploadFile = requests.post(UploadURL, files=file, allow_redirects=False)

But i'm getting this error:

'MultipartEncoder' object is not iterable

How to fix that?

1 Answer 1

1

You must pass the MultpartEncoder() instance to the data keyword argument, not files:

UploadFile = requests.post(UploadURL, data=file, allow_redirects=False)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.