owncloud / pyocclient

ownCloud client library for Python
MIT License
294 stars 115 forks source link

Have Access to Upload File Progress #219

Open G-Pereira opened 6 years ago

PVince81 commented 6 years ago

Maybe you can add a callback that is triggered from within the loop that copies the bytes in all the upload functions ?

G-Pereira commented 6 years ago

A callback how so? Make the upload function, asynchronous?

PVince81 commented 6 years ago

@G-Pereira not sure about making it asynchronous. I mostly thought the callback could be called within the loop that copies the bytes. It also means that whatever you do in the callback will block further copy. If it's only about updating progress info and continuing that should be enough.

G-Pereira commented 6 years ago

@PVince81 Só you mean I can do that in the chunked versions?

PVince81 commented 6 years ago

You could add this to both chunked and non-chunked variants. Make sure the callback returns the correct number of current and total bytes then.

jdhirst commented 6 years ago

I second this, having access to upload progress would be very useful. Download is fine as bytes received can be counted locally but upload is not as the file will simply appear in the server upon upload completion.

MSSandroid commented 1 year ago

Maybe this could be realized through incorporating something like https://gist.github.com/tyhoff/b757e6af83c1fd2b7b83057adf02c139 into here https://github.com/owncloud/pyocclient/blob/fe5c11edc92e1dc80d9683c3a16ec929749a5343/owncloud/owncloud.py#L589 for non chunked upload. For chunked upload one could simply show the chunks uploaded (use e.g. tqdm in this loop: https://github.com/owncloud/pyocclient/blob/fe5c11edc92e1dc80d9683c3a16ec929749a5343/owncloud/owncloud.py#L674)

Yaffa16 commented 1 year ago

hi, has this been added?