/ctdl/objectClass/[container/]object[/operation]
## We are using
-* libcitadel for information about the Citadel server, some string handling, and the JSON encoder
+* libcitadel for Citadel server tooling, string handling, JSON encoder, MIME parser
* Expat for DAV handling
* OpenSSL for TLS
* FontAwesome for icons
GET /ctdl/c/info Returns a JSON representation of the output of an INFO server command
POST /ctdl/a/login Send it a your credentials and it will log you in
GET /ctdl/a/whoami
+GET /ctdl/a/biff Check for new mail
+POST /ctdl/a/upload Handler for uploading attachments and other file items
GET /ctdl/u/USERNAME/userpic Returns an image containing the photo/avatar of the specified user
GET /ctdl/s/ Static content (html, css, js, images...)
GET /.well-known/ Static content (RFC5785 compliant paths)
biff(h, c);
return;
}
+ if (!strcasecmp(h->url, "/ctdl/a/upload")) { // upload files
+ upload_files(h, c);
+ return;
+ }
do_404(h); // unknown
}
int webcit_tcp_server(const char *ip_addr, int port_number, int queue_len);
void UrlizeText(StrBuf* Target, StrBuf *Source, StrBuf *WrkBuf);
void json_render_one_message(struct http_transaction *h, struct ctdlsession *c, long msgnum);
+void upload_files(struct http_transaction *h, struct ctdlsession *c);
function uploadFile(file) {
- var url = '/ctdl/zzz/attach_it;'
+ var url = '/ctdl/a/upload';
var xhr = new XMLHttpRequest();
var formData = new FormData();
xhr.open('POST', url, true);