I am developing a Google Script application to determine the size of a remote resource without downloading it . The code is as follows
function getRemoteFileSize()
{
var params = { "method" : "head" };
var resp = UrlFetchApp.fetch("https://www.google.com/images/srpr/logo11w.png", params);
Logger.log("Remote File Size: " + resp.getAllHeaders()["Content-Length"]);
}
However, Google App Script does not seem to support head-end queries, and the code above cannot be executed.
What could be a viable alternative besides issuing a request GET?
I am open to all offers, including the use of a third-party service with an API
source
share