When you download a file with the method in the example, you'll get a server message, followed by the contents of the file. If I want to print only the contents of the file. The contents are separated from server info by a double enter.("\r\n\r\n"). I do this:
if string.find(buffer,"\r\n\r\n") then print(string.sub(buffer,string.find(buffer,"\r\n\r\n"))) end
But it doesn't work. string.find has two outputs, the start and end where it found the "\r\n\r\n". How do I handle this? How can I tell string.sub to use only the first output of find(start position)? And why doesn't it print anything?
string.find returns 2 values: start of found pattern and end. How can I tell string.sub to use the last value + 1 ? (I'm now using starting value+4 wich is basicly the same, just curious)