Hello all:
I'm having trouble copying a remote image to a local server.
def url = "http://domain.com/images/foo.jpg".toURL()
def outFile = new File("./a.jpg")
outFile << url.text
This works when I run it locally (Groovy 1.6.3 - JVM 1.6.0_17 on OSX) but not
when I run it on a Grails system (Grails 1.2.0 JVM 1.6.0_17 on Centos 5.3).
The resulting file sizes are different, and while they both look like binary
files, one is renderable and one isn't.
There's probably a better way to do this, but I can not figure it out. Any
pointers on the 'groovy' way to do this? FWIW '.text' doesn't seem like the
right thing to be doing, because it's binary data I want, but it's working fine
in one system, just not the 'live' one I need.
Thanks.