You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
forpieceinread_in_chunks(fh, size=self._chunk_size): # when the bytes are over, the loop gets out, without calling the else in the previous codeiff_pos==0:
upload_result=files.get_by_url(file_name).start_upload(self._upload_id, piece)
eliff_pos+len(piece) <st.st_size:
upload_result=files.get_by_url(file_name).continue_upload(self._upload_id, f_pos, piece)
f_pos+=len(piece)
# in my opinion this should always be called, as this is what tells sharepoint to close the fileself._target_file=files.get_by_url(file_name).finish_upload(self._upload_id, f_pos, piece)
The text was updated successfully, but these errors were encountered:
thanks for spotting this bug, indeed, due to the recent changes to ClientContext, continue_upload among with finish_upload stopped gets triggered, that's the reason why the file gets uploaded as an empty one.
The good news, the latest commit addresses this particular issue (and it is now part of unit tests).
And since it is not yet published into PyPI, the latest version could be grabbed from GitHub:
Hi Folks,
I have used the example provided to upload a big file. It creates the file in Sharepoint but the contents are not filled.
After some debugging, it seemed to me that the upload operation would start but would never be finished.
So I did the following changes to the code:
file
upload_session.py
from:
to
The text was updated successfully, but these errors were encountered: