Project

General

Profile

Bug #1582 ยป fileres.cpp

Boris Nagaev, 11/28/2012 09:40 PM

 

#include <Wt/WApplication>
#include <Wt/WContainerWidget>
#include <Wt/WFileResource>
#include <Wt/WAnchor>

using namespace Wt;

class MyApp : public WApplication {
public:
MyApp(const WEnvironment& env):
WApplication(env) {
WFileResource* f = new WFileResource("application/octet-stream",
"empty-file.txt", root());
f->suggestFileName("1.txt");
WAnchor* a = new WAnchor(root());
a->setResource(f);
a->setText("anchor");
}
};

WApplication* createApplication(const WEnvironment& env) {
return new MyApp(env);
}

int main(int argc, char** argv) {
return WRun(argc, argv, &createApplication);
}


    (1-1/1)