Skip to content

Instantly share code, notes, and snippets.

@nesterione
Created November 10, 2015 21:39
Show Gist options
  • Select an option

  • Save nesterione/d05dee6d16013176a017 to your computer and use it in GitHub Desktop.

Select an option

Save nesterione/d05dee6d16013176a017 to your computer and use it in GitHub Desktop.
res.write("HTTP/1.1 200 OK\r\n".getBytes());
res.write("Date: Mon, 23 May 2005 22:38:34 GMT\r\n".getBytes());
res.write("Server: HApache/1.3.3.7 (Unix) (Red-Hat/Linux)\r\n".getBytes());
res.write("Content-Type: image/jpg\r\n".getBytes());
res.write("Content-Disposition: attachment; filename=home.jpg\r\n".getBytes());
res.write(String.format("Content-Length: %d\r\n",imageInByte.length).getBytes());
res.write("Accept-Ranges: bytes\r\n".getBytes());
res.write("Connection: close\r\n".getBytes());
res.write("\r\n".getBytes());
res.write(imageInByte);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment