I'm trying to create a roBitmap from a downloaded image file, but it isn't working. Here's the code snippet:
sTempFile = "tmp:/temp.jpg"
iResult = UT.GetToFile(sTempFile)
print "Download status code: "; iResult
if (FileExists(sTempFile) = true) then
print "Downloaded media file exists"
print "Downloaded media file does NOT exist"
img1 = CreateObject("roBitmap", sTempFile)
if (img1 = Invalid) then
print "roBitmap Invalid!"
'Does file exist
Function FileExists(file as String) as Integer
fs = CreateObject("roFileSystem")
If fs.Exists(file) Then
stats = fs.Stat(file)
print "Type = ";stats.type;", size="; stats.size
And here is the result:
Download status code: 200
Type = file, size= 2994370
Downloaded media file exists
Any idea on why this doesn't work? Or is there an error code somewhere I can check for more detail?
BTW, I'll switch to the async version once I get this working.