Skip to content

Commit

Permalink
use dynamic content-type on the file
Browse files Browse the repository at this point in the history
  • Loading branch information
genaromadrid committed Jun 14, 2016
1 parent 72509df commit 9a6aaa3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mifiel/document.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from mifiel import Base
import mimetypes

class Document(Base):
def __init__(self, client):
Expand Down Expand Up @@ -28,8 +29,9 @@ def create(client, signatories, file=None, dhash=None, callback_url=None):
if callback_url:
data['callback_url'] = callback_url
if file:
mimetype = mimetypes.guess_type(file)[0]
_file = open(file, 'rb')
file = {'file':(basename(_file.name), _file, 'application/pdf')}
file = {'file': (basename(_file.name), _file, mimetype)}
if dhash:
data['original_hash'] = dhash

Expand Down

0 comments on commit 9a6aaa3

Please sign in to comment.