optimize readline()

Use less memory when processing file uploading, to be fast and safe