Function Updated 17 Oct 2026
downloadFromUrl(url)
Downloads text from the specified URL. Pass several URLs to download them in order and get the texts joined into one string. Only http:// and https:// URLs are allowed; a URL starting with // is called as http://. The request goes through the same outbound guard as httpFetch: Docly controller domains and link-local/cloud-metadata addresses are blocked. Throws if the download fails or the server answers with an error status.
Parameters
urlstringrequiredURL to download with HTTP GET (http:// or https://). More URLs can follow as extra arguments.
Returns
Returns the downloaded text (all texts joined, when several URLs are given). Returns null when called without arguments.
Example
Mixed HTML (or any text file) with inline JavaScript between hash signs.
#{
var text = docly.downloadFromUrl("https://example.com/data.txt");
write(text);
}#The template above produces this output:
No demo available.