}
u.id[sizeof(u.id)-1] = 0;
+ syslog(LOG_DEBUG,
+ "upload_handler: name=%s, filename=%s, partnum=%s, disp=%s, cbtype=%s, cbcharset=%s, length=%ld, encoding=%s, cbid=%s",
+ name, filename, partnum, disp, cbtype, cbcharset, length, encoding, cbid
+ );
+
safestrncpy(u.filename, filename, sizeof(u.filename));
safestrncpy(u.content_type, cbtype, sizeof(u.content_type));
u.length = length;
JsonArrayAppend(j_uploads, j_one_upload);
}
+
// upload handler
void upload_files(struct http_transaction *h, struct ctdlsession *c) {
// FIXME reject uploads if we're not logged in
// so the attachments don't have to be sent out to the browser and back.
void load_attachments_from_message(struct http_transaction *h, struct ctdlsession *c, char *name) {
syslog(LOG_DEBUG, "\033[33mload_attachments_from_message: method is \033[35m%s\033[33m, name is \033[33m%s\033[0m", h->method, name);
+
+ char buf[1024];
+ StrBuf *Body = NULL;
+
+ ctdl_printf(c, "MSG2 %ld", atol(name));
+ ctdl_readline(c, buf, sizeof buf);
+ if (buf[0] != '1') {
+ do_404(h);
+ return;
+ }
+
+ while (ctdl_readline(c, buf, sizeof buf), strcmp(buf, "000")) {
+ // do something
+ }
+
do_405(h);
}
"</div>"; // end header
}
- // Display attachments, if any are present
- if (msg.part) {
+ // Display attachments, if any are present (don't do this if we're quoting the message)
+ if ( (msg.part) && (include_controls) ) {
let display_attachments = 0;
for (let r=0; r<msg.part.length; ++r) {
if (msg.part[r].disp == "attachment") {