PDA

View Full Version : My ftp application getting success on desktop but failed when testing on the devices



srf.hidayat
25th February 2010, 12:51
I've written my code to upload image using qt for symbian devices, my application was getting success to upload image or xml file on the desktop to the server. But when it testing on nokia 5800, my phone hang and failed to upload image as well as xml file. Below is my code that i've written to upload image:

.................................................. ................................

void MainWindow::sendFileToServer(QString filename)
{

QFile transferedImage(filename);


if (!transferedImage.open(QIODevice::ReadOnly))
{

QMessageBox msgBox;
msgBox.setText("File Not Found");
msgBox.exec();

}


QByteArray arrayImage = transferedImage.readAll();


connection = new QFtp();
connect(connection, SIGNAL(dataTransferProgress(qint64,qint64)),this, SLOT(updateDataTransferProgress(qint64,qint64)));
QObject::connect(connection, SIGNAL(done(bool)), this, SLOT(closeConnection()));

connection->connectToHost(ui->editIPAddress->text());
connection->login("suresh", "suresh");
connection->put(arrayImage, "HASIL.png", QFtp::Binary);

}

.................................................. .................................................
anyone can give me advice and show me what wrong with my code

Archimedes
25th February 2010, 13:47
You mean the application runs on your desktop as a symbian application, I mean it runs on the emulator correctly?
Cause the above code seems ok.

srf.hidayat
26th February 2010, 01:29
its getting success run as dekstop application not on symbian simulator, the code ported to qt for symbian. Fiisrt, when it testing on my devices my phone is getting hang. Getting suggestion from someone to include sym_iap_util.h and add qt_SetDefaultIap() to my code and me myself initiative to add several linking to socket library such ac esock and insock library same as we can see on QFtp examples. my phone is not getting hang anymore but my application close unexpectedly without upload anything.