however, when the file is empty, thisblock == 0 is true and we break out of the loop. This leads to an error message in the final line:
Error in httr::content(res) : object 'res' not found
because res is never created. It should possibly be an error message indicating that the file is empty or preferably result in an empty file being uploaded.
when using an ms_drive_item to attempt to upload a file these lines in are evaluated at some point: https://github.com/Azure/Microsoft365R/blob/aaad2dd424ce9ac1817c3dfe40ebace8871773f3/R/ms_drive_item.R#L582
however, when the file is empty,
thisblock == 0
is true and we break out of the loop. This leads to an error message in the final line:Error in httr::content(res) : object 'res' not found
because res is never created. It should possibly be an error message indicating that the file is empty or preferably result in an empty file being uploaded.
(otherwise a great package, tnx!)