Hi,

I'm using wt 2.2.4 file upload widget. It works in localhost:8080, but not
from the internet.
wthttpd just shows a post but the `uploaded` signal is not fired. What could
be going wrong?
The point is to use debian/ubuntu repository packages to make something out
of the box.

#include <Wt/WApplication>
#include <Wt/WText>
#include <Wt/WContainerWidget>
#include <Wt/WPushButton>
#include <Wt/WFileUpload>
#include <Wt/WBreak>
#include <Wt/WLogger>

using namespace Wt;

struct TesseractCgi: WApplication
{
    WPushButton* btnPictureUpload;
    WFileUpload* fuPicture;
    WText* txtMesaj;
    TesseractCgi(WEnvironment const &env)
    : WApplication(env)
    {
        txtMesaj= new WText("File Uploader", root());
        root()-> addWidget(new WBreak());
        fuPicture= new Wt::WFileUpload(root());
        root()-> addWidget(new WBreak());
        btnPictureUpload= new WPushButton("File Upload", root());
        root()-> addWidget(new WBreak());
        btnPictureUpload->clicked.connect(SLOT(this,
TesseractCgi::btnPictureUpload_Clicked));
        fuPicture->uploaded.connect(SLOT(this,
TesseractCgi::fuPicture_Uploaded));
    }

    void btnPictureUpload_Clicked(WMouseEvent const &)
    {
        fuPicture->upload();
    }

    void fuPicture_Uploaded()
    {
        fuPicture->setHidden(true);
        txtMesaj->setText("File Uploaded!");
        log("trace") << "File name: "<< fuPicture->clientFileName();
    }
};

WApplication* run(WEnvironment const &env)
{
    return new TesseractCgi(env);
}

int main(int argc, char* argv[])
{
    return WRun(argc, argv, &run);
}
------------------------------------------------------------------------------
Gaining the trust of online customers is vital for the success of any company
that requires sensitive data to be transmitted over the Web.   Learn how to 
best implement a security strategy that keeps consumers' information secure 
and instills the confidence they need to proceed with transactions.
http://p.sf.net/sfu/oracle-sfdevnl 
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to