Skip to content

Commit a4d1e45

Browse files
committed
fixes issue #2 on github: incorrect mime type on POST media file uploads
Signed-off-by: Neal Ensor <ensorn@osti.gov>
1 parent 1abac6e commit a4d1e45

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "elinkapi"
7-
version = "0.3.4"
7+
version = "0.3.4.1"
88
authors = [
99
{ name="Jacob Samar", email="samarj@osti.gov" },
1010
{ name="Neal Ensor", email="ensorn@osti.gov" }

src/elinkapi/elinkapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ def post_media(self, osti_id, file_path=None, title=None, url=None):
379379
if file_path is not None:
380380
response = requests.post(f'{self.target}media/{osti_id}{query_params}',
381381
headers = { "Authorization" : f"Bearer {self.token}" },
382-
files={ 'file' : file_path})
382+
files={ 'file' : open(file_path, 'rb') })
383383
else:
384384
response = requests.post(f'{self.target}media/{osti_id}{query_params}',
385385
headers = { "Authorization" : f"Bearer {self.token}",

0 commit comments

Comments
 (0)