Logo Search packages:      
Sourcecode: qcake version File versions  Download package

int QtNPBindable::uploadFile ( const QString &  url,
const QString &  window,
const QString &  filename 
)

Posts filename to url, and displays the result in window. Returns the ID of the request that is delivered to transferComplete() when the post-operation has finished. Returns 0 when the browser or the system doesn't support notification, or -1 when an error occured.

    void MyPlugin::uploadFile()
    {
        uploadFile("ftp://ftp.somewhere.com/incoming", "response", "c:\\temp\\file.txt");
    }

See Netscape's JavaScript documentation for an explanation of window names.

See also:
transferComplete() uploadData() openUrl()

Definition at line 1545 of file qtbrowserplugin.cpp.

{
    if (!pi)
        return -1;

    QByteArray data = filename.toLocal8Bit();
    int id = pi->getNotificationSeqNum();
    if (NPERR_NO_ERROR != NPN_PostURLNotify(pi->npp, url.toLocal8Bit().constData(), window.isEmpty() ? 0 : window.toLocal8Bit().constData(), data.size(), data.constData(), true, reinterpret_cast<void*>(id)))
        id = -1;

    return id;
}


Generated by  Doxygen 1.6.0   Back to index