Does anyone know how to do direct-to-disk http dow...
# cfml-general
j
Does anyone know how to do direct-to-disk http downloads in lucee? cfhttp wants to read the entire file into memory before I can save it and I need to grab a 28GB file from an S3 signed url regularly.
b
You can write your own HTTP client to do this
If you look at the progressable downloader in CommandBox, you can get an idea
I write the file to disk and I THINK it doesn't stay in memory-- I'd have to actually test that
But it's basically a matter of looping over an input stream and writing out the bytes as they come in
j
gotcha. I do that on arduinos
b
I'm curious if BoltHTTP does this-- if not, would be a great addition cc @foundeo
CFHTTP really should provide a way to do it too.
j
agreed
f
I don’t think BoltHTTP does support it
j
FWIW, this looks like an option, but not sure how to create the URL and File objects - passing strings doesn't work https://commons.apache.org/proper/commons-io/apidocs/org/apache/commons/io/FileUtils.html#copyURLToFile-java.net.URL-java.io.File-int-int-
e
You could just use cfexcecute to run rsync, or if it's UNIX and do you absolutely know what you are doing you could use 'dd'