X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fserver%2Fmessages.c;h=adbb2b8f7c8f9142aeaff676ae5765eb5563a54b;hb=aa2dc955ddd301f4ca0b9aa4e92fe31c4573bfde;hp=ef244aab059ac08a4bb4e46cc2afa1564aaf1db3;hpb=9e99938c31d779fb37e7f5ebc6745b92131581d8;p=citadel.git diff --git a/webcit-ng/server/messages.c b/webcit-ng/server/messages.c index ef244aab0..adbb2b8f7 100644 --- a/webcit-ng/server/messages.c +++ b/webcit-ng/server/messages.c @@ -232,6 +232,21 @@ void dav_put_message(struct http_transaction *h, struct ctdlsession *c, char *eu extract_token(attid, att, i, ',', sizeof(attid)); one_att = pop_upload(attid); syslog(LOG_DEBUG, "💥 attachment: %s", one_att.filename); + ctdl_printf(c, "--%s--\r", mime_boundary); + ctdl_printf(c, "Content-Type: %s; name=\"%s\"\r", one_att.content_type, one_att.filename); + ctdl_printf(c, "Content-Disposition: attachment; filename=\"%s\"\r", one_att.filename); + ctdl_printf(c, "Content-Transfer-Encoding: base64\r"); + ctdl_write(c, HKEY("\r\n")); + + char *raw_att = malloc(one_att.length); + if (raw_att) { + fread(raw_att, one_att.length, 1, one_att.fp); + + // now encode it + + } + + fclose(one_att.fp); } // Close the multipart/mixed MIME container.