+ char buf[1024];
+ int content_length = 0;
+ char content_type[1024];
+ char *image = NULL;
+ int actual_length = 0;
+
+ ctdl_printf(c, "DLUI %s", username);
+ ctdl_readline(c, buf, sizeof(buf));
+ if (buf[0] == '6') {
+ content_length = extract_int(&buf[4], 0);
+ extract_token(content_type, &buf[4], 3, '|', sizeof content_type);
+
+ image = malloc(content_length);
+ if (image == NULL) {
+ do_502(h);
+ return;
+ }
+ actual_length = ctdl_read_binary(c, image, content_length);