Skip to content

Instantly share code, notes, and snippets.

@omaciel
Last active December 20, 2015 06:59
Show Gist options
  • Save omaciel/6089995 to your computer and use it in GitHub Desktop.
Save omaciel/6089995 to your computer and use it in GitHub Desktop.
my_file = open('ダウンロード/og-cfse-2.zip')
lines = []
boundary = '----------BOUNDARY_$'
lines.append('--' + boundary)
lines.append('Content-Disposition: form-data; name="foo"; filename="%s"' % my_file.name)
content = my_file.read()
lines.append(content)
lines.append('--' + boundary + '--')
'\r\n'.join(lines)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment