Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Now uploaded files will be uploaded with the encoded filename
  • Loading branch information
Alejandro Casanovas committed Jul 9, 2019
1 parent 1f89580 commit e7c3782
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions O365/drive.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import warnings
from pathlib import Path
from time import sleep
from urllib.parse import urlparse
from urllib.parse import urlparse, quote

from dateutil.parser import parse

Expand Down Expand Up @@ -1169,7 +1169,7 @@ def upload_file(self, item, chunk_size=DEFAULT_UPLOAD_CHUNK_SIZE):
# Simple Upload
url = self.build_url(
self._endpoints.get('simple_upload').format(id=self.object_id,
filename=item.name))
filename=quote(item.name)))
# headers = {'Content-type': 'text/plain'}
headers = {'Content-type': 'application/octet-stream'}
# headers = None
Expand All @@ -1188,7 +1188,7 @@ def upload_file(self, item, chunk_size=DEFAULT_UPLOAD_CHUNK_SIZE):
# Resumable Upload
url = self.build_url(
self._endpoints.get('create_upload_session').format(
id=self.object_id, filename=item.name))
id=self.object_id, filename=quote(item.name)))

response = self.con.post(url)
if not response:
Expand Down

0 comments on commit e7c3782

Please sign in to comment.