lycis / QtDropbox

Dropbox API for Qt
GNU Lesser General Public License v3.0
102 stars 47 forks source link

Qtdropbox uploading issue #49

Open ricardosalinase opened 9 years ago

ricardosalinase commented 9 years ago

Hi Daniel, hope you are doing great! I'm checking back to ask if QT Dropbox is still working? I was trying to upload a video with QT Dropbox and the code confirms that everything worked fine (login as well as upload) however if I open the Dropbox folder online, no uploaded video will show up. Am I right with the assumption that this could be connected to the recent update of the Dropbox API? Attached you will find an extract from the code that is responsible for the video upload.

Best regards.

/* code */ void MainDropbox::sendToDropbox(QString path) {

QByteArray data;
connectDropbox(&dropbox, QDropbox::Plaintext);
QDropboxAccount accInf = dropbox.requestAccountInfoAndWait();
if(dropbox.error() == QDropbox::NoError){

    QFile local(path);
    if(!local.open(QFile::ReadOnly))
    {
        qDebug()<<path << "Cant read local";
        return;
    }
    else
    {
        data = local.readAll();
    }
    QDropboxFile destination("/Dropbox/test.mp4",&dropbox);
    if(!destination.open(QDropboxFile::WriteOnly)){
        qDebug()<<path << "Cant write to Dropbox";
        return;
    }
    else
    {
        if(destination.write(data) > 0)qDebug()<<"successfull request";
        else qDebug()<<"ERROR";
    }

}

ecspertiza commented 8 years ago

Hi guys, i use your lib on mac os, and lib crashed some times. I review code, and look this part

http://dl3.joxi.net/drive/0000/0047/47/151223/8e4c7d8ed1.jpg

for my mind, not wery good delete object before read data.

Thank you for you lib, she made my life easier :-)