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
Calling files.upload_stream is not working with NextCloud 30.0.2 unless chunk_size is below 5 * 1024 * 1024
Steps/Code to Reproduce
from io import BytesIO
from PIL import Image # this example requires `pillow` to be installed
import nc_py_api
if __name__ == "__main__":
nc = nc_py_api.Nextcloud(nextcloud_url="http://nextcloud.local", nc_auth_user="admin", nc_auth_pass="admin")
buf = BytesIO()
Image.merge(
"RGB",
[
Image.linear_gradient(mode="L"),
Image.linear_gradient(mode="L").transpose(Image.ROTATE_90),
Image.linear_gradient(mode="L").transpose(Image.ROTATE_180),
],
).save(
buf, format="PNG"
) # saving image to the buffer
buf.seek(0) # setting the pointer to the start of buffer
nc.files.upload_stream("RGB.png", buf) # uploading file from the memory to the user's root folder
exit(0)
### Expected Results
File is uploaded successfully
### Actual Results
NextcloudException: [400] Bad Request <upload_stream(v=True): user=admin, path=RGB.png, cur_size=759>
### Setup configuration
nc_py_api = 0.18.0
nextcloud = 30.0.2
The text was updated successfully, but these errors were encountered:
Describe the bug
Calling
files.upload_stream
is not working with NextCloud 30.0.2 unless chunk_size is below 5 * 1024 * 1024Steps/Code to Reproduce
The text was updated successfully, but these errors were encountered: