diff --git a/R/blob_client_funcs.R b/R/blob_client_funcs.R index ac1c258..1e43181 100644 --- a/R/blob_client_funcs.R +++ b/R/blob_client_funcs.R @@ -253,7 +253,8 @@ upload_blob <- function(container, src, dest, type="BlockBlob", blocksize=2^24, if(thisblock == 0) break - headers[["content-length"]] <- thisblock + # ensure content-length is never exponential notation + headers[["content-length"]] <- sprintf("%.0f", thisblock) id <- openssl::base64_encode(sprintf("%s-%010d", dest, i)) opts <- list(comp="block", blockid=id) diff --git a/R/file_client_funcs.R b/R/file_client_funcs.R index ac7b37c..b75b5d3 100644 --- a/R/file_client_funcs.R +++ b/R/file_client_funcs.R @@ -215,8 +215,9 @@ upload_azure_file <- function(share, src, dest, blocksize=2^24) on.exit(close(con)) # first, create the file + # ensure content-length is never exponential notation headers <- list("x-ms-type"="file", - "x-ms-content-length"=nbytes) + "x-ms-content-length"=sprintf("%.0f", nbytes)) do_container_op(share, dest, headers=headers, http_verb="PUT") # then write the bytes into it, one block at a time @@ -233,7 +234,8 @@ upload_azure_file <- function(share, src, dest, blocksize=2^24) if(thisblock == 0) # sanity check break - headers[["content-length"]] <- thisblock + # ensure content-length is never exponential notation + headers[["content-length"]] <- sprintf("%.0f", thisblock) headers[["range"]] <- sprintf("bytes=%s-%s", range_begin, range_begin + thisblock - 1) do_container_op(share, dest, headers=headers, body=body, options=options, http_verb="PUT")