Ok, the long awaited config wizard is here (at least in a very basic state). There...
[quassel.git] / src / contrib / libqxt-2007-10-24 / tests / web / upload / main.cpp
1 #include <QCoreApplication>
2 #include <QxtWebCore>
3 #include <QxtWebController>
4 #include <QxtFcgiConnector>
5 #include <QTimer>
6 class test : public QxtWebController
7 {
8 Q_OBJECT
9 public:
10     test():QxtWebController("root")
11     {
12     }
13
14 public slots:
15
16     int index()
17     {
18         echo()<<
19             "<form method='POST' enctype='multipart/form-data' action='/root/upload'>"
20             "File to upload: <input type=file name=upfile><br>"
21             "Notes about the file: <input type=text name=note><br>"
22             "<br>"
23             "<input type=submit value=Press> to upload the file!"
24             "</form>";
25         return 0;
26     }
27     int upload()
28     {
29
30         QByteArray d= QxtWebCore::content(100000000);
31         QxtWebCore::sendHeader();
32
33         QByteArray io;
34         QxtWebCore::socket()->write(d);
35         return 0;
36     }
37 };
38
39
40
41
42
43 int main(int argc, char *argv[])
44 {
45     QCoreApplication app(argc, argv);
46     QxtWebCore core(new QxtFcgiConnector());
47     core.start();
48     test t;
49     return app.exec();
50 }
51
52
53 #include "main.moc"