To reduce latency, I'm looking to pre-cache images used in a Poster node.
When trying to write to tmp:/ it shows the filename with a ".tmp" extension and then disappears. I assume this means the file is not downloading properly.. Any idea what the issue could be?
From my screen: (this loops every 5 seconds with a new URL)
m.downloadTask = createObject("roSGNode", "urlgrabber")
m.downloadTask.contenturi = url
m.downloadTask.control = "RUN"
From my download Task:
mypath = CreateObject("roPath", m.top.contenturi)
fileObj = myPath.Split()
print "DOWNLOADING: "; m.top.contenturi
UT = createObject("roUrlTransfer")
port=CreateObject("roMessagePort")
UT.SetPort(port)
UT.setUrl(m.top.contenturi)
UT.AsyncGetToFile( "tmp:/" + fileObj.filename )
fs = CreateObject("roFileSystem")
fslist = fs.GetDirectoryListing("tmp:/")
print fs.Stat("tmp:/" + fileObj.filename + ".tmp")
print "FILESYSTEM: "; fslist
All i ever get it the following:
DOWNLOADING: https://lh3.googleusercontent.com/-uAxkRqQIagw/WKOY5CA6xFI/AAAAAAAAGUE/9y4gUaP6OhEX7G2wvT_oMHu2wFKJYiPbACHMYBhgL/s1280/stock-coral-reef-fish-egypt.jpg
<Component: roAssociativeArray> =
{
ctime: <Component: roDateTime>
hidden: false
mtime: <Component: roDateTime>
permissions: "rw"
size: 0
type: "file"
}
FILSYSTEM: <Component: roList> =
(
"stock-coral-reef-fish-egypt.jpg.tmp"
)
Thanks!