What Changed In Network.download Event Listener?

In previous versions (971 and 1058) I used the example code to setup my network.download. In my listener, I print to the terminal the event.response. It worked fine. But now, in the latest build 1061, I print to the terminal and I get a Runtime error.

attempt to concatenate field ‘response’ (a table value)

   [lua] local function networkListener( event )         if ( event.isError ) then                 print ( "Network error - download failed" )                 local e = display.newText("Network error - download failed",10,10)         end         print ( "RESPONSE: " .. event.response .."\n\n\n\n\n")     -- left out for brevity     end  network.download("http://192.168.1.83/bookstore/books.php", "GET", networkListener, "booklist\_data",system.TemporaryDirectory) [/lua]

Hi there,

According to the API documentation, for network.download() requests that are directed to file, event.response is a table with the filename and the directory.  http://docs.coronalabs.com/daily/api/event/networkRequest/response.html

I think this has been the case since Networking 2.0 rolled out in Build 1043 (although you mentioned you thought you didn’t see it in 1058).

  • Andrew

Thanks! I could be wrong, but I thought it was working fine in 1058, but anyways, I see now how to use the new method.

Hi there,

According to the API documentation, for network.download() requests that are directed to file, event.response is a table with the filename and the directory.  http://docs.coronalabs.com/daily/api/event/networkRequest/response.html

I think this has been the case since Networking 2.0 rolled out in Build 1043 (although you mentioned you thought you didn’t see it in 1058).

  • Andrew

Thanks! I could be wrong, but I thought it was working fine in 1058, but anyways, I see now how to use the new method.