X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit-ng%2Fserver%2Fupload.c;h=9fd363838e3cf6ff3d0a20b5e9cf7630385e2711;hb=1a061e3dcbc2789e86224e3a67d94608bd20deb7;hp=1d7fbf95676ae64710160d03b7753ccb4a3acd41;hpb=1c80a967ee3b72c82a95f7dbb951fa68adccb1d8;p=citadel.git diff --git a/webcit-ng/server/upload.c b/webcit-ng/server/upload.c index 1d7fbf956..9fd363838 100644 --- a/webcit-ng/server/upload.c +++ b/webcit-ng/server/upload.c @@ -1,6 +1,6 @@ // Upload handler // -// Copyright (c) 1996-2022 by the citadel.org team +// Copyright (c) 1996-2023 by the citadel.org team // // This program is open source software. Use, duplication, or // disclosure are subject to the GNU General Public License v3. @@ -70,4 +70,15 @@ void upload_files(struct http_transaction *h, struct ctdlsession *c) { h->response_string = strdup("OK"); h->response_body_length = StrLength(sj); h->response_body = SmashStrBuf(&sj); -} \ No newline at end of file +} + + +// Dispatcher for paths starting with /ctdl/p/ +void ctdl_p(struct http_transaction *h, struct ctdlsession *c) { + if (!strcasecmp(h->url, "/ctdl/p/")) { // upload files + upload_files(h, c); + return; + } + + do_404(h); // unknown +}