}
-void download_file(char *filename)
+void download_file(void)
{
char buf[256];
off_t bytes;
/* Setting to nonzero forces a MIME type of application/octet-stream */
int force_download = 1;
- safestrncpy(buf, filename, sizeof buf);
+ safestrncpy(buf, ChrPtr(WC->UrlFragment1), sizeof buf);
unescape_input(buf);
serv_printf("OPEN %s", buf);
serv_getln(buf, sizeof buf);
strcpy(WCC->ImportantMessage, &buf[4]);
display_room_directory();
}
+
+void
+InitModule_DOWNLOAD
+(void)
+{
+ WebcitAddUrlHandler(HKEY("display_room_directory"), display_room_directory, 0);
+ WebcitAddUrlHandler(HKEY("display_pictureview"), display_pictureview, 0);
+ WebcitAddUrlHandler(HKEY("download_file"), download_file, NEED_URL);
+ WebcitAddUrlHandler(HKEY("upload_file"), upload_file, 0);
+}