Skip to content

Instantly share code, notes, and snippets.

@dwsmart
Created January 17, 2023 17:09
Show Gist options
  • Save dwsmart/1e947a0a57ff05d2668682040650eb51 to your computer and use it in GitHub Desktop.
Save dwsmart/1e947a0a57ff05d2668682040650eb51 to your computer and use it in GitHub Desktop.
get file size from url
# google sheets app script to get file size in bytes from a url
function getSizes(theurl) {
const response = UrlFetchApp.fetch(theurl);
const blob = response.getBlob()
const size = blob.getBytes().length
return size
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment