
KIO::TransferJob *put(const KURL& url, int permission, bool overwrite, bool resume, bool showProgressInfo) |
The end location for your data
Special permissions for your data. This should be set to -1 if there are no special permissions
Instructs the ioslave to overwrite anything that may already be there.
Instructs the ioslave to resume a previously aborted transaction.
If true (default), a progress info dialog will popup during long downloads.
This operation will start the process of "putting" or sending data to the location specified in the URL. This is used, for instance, to send files to a remote FTP server or do do a PUT request with HTTP. It is not quite a straight-forward as a get() operation... but is still easy enough. The only big difference is that you need to supply your data to upload in response to the dataReq() signal.
Client::Client()
{
KIO::TransferJob *job = KIO::put("ftp://remote.server.com/pub", -1, false, false);
connect(job, SIGNAL(dataReq(KIO::Job*, QByteArray&))
this, SLOT(slotDataReq(KIO::Job*, QByteArray&)));
connect(job, SIGNAL(result(KIO::Job*)),
this, SLOT(slotResult(KIO::Job*)));
}
void Client::slotDataReq(KIO::Job*, QByteArray& data)
{
QCString local_data("My Data");
data.duplicate(local_data);
}
|