int fileLength = connection.getContentLength();
currentDownloadSize = fileLength;
if ( fileLength > availableSize ) return "not enough space on sd-card";
input = connection.getInputStream();
int slidx = surl.lastIndexOf( "segments4/" );
<BUG>fname = baseDir + "/brouter/segments3/" + surl.substring( slidx+10 );
</BUG>
tmp_file = new File( fname + "_tmp" );
output = new FileOutputStream( tmp_file );
byte data[] = new byte[4096];

int fileLength = connection.getContentLength();
currentDownloadSize = fileLength;
if ( fileLength > availableSize ) return "not enough space on sd-card";
input = connection.getInputStream();
int slidx = surl.lastIndexOf( "segments4/" );
fname = baseDir + "/brouter/segments4/" + surl.substring( slidx+10 );
tmp_file = new File( fname + "_tmp" );
output = new FileOutputStream( tmp_file );
byte data[] = new byte[4096];
