Note that there are some explanatory texts on larger screens.

plurals
  1. POon uploading file to google-drive by using c++/qt filename of newfile is always untitled
    text
    copied!<p>I found a similar question: <a href="https://stackoverflow.com/questions/11797896/google-drive-api-insert-new-file-with-untitled-name">Google Drive API insert new file with Untitled name</a> but code is not attached there.</p> <p>My code:</p> <pre><code>void googled::newuploadSettings(QNetworkReply *reply){ QByteArray data = reply-&gt;readAll(); qDebug() &lt;&lt; data; QString x = getValue(data,"access_token"); qDebug() &lt;&lt; x; x = "Bearer " + x; qDebug() &lt;&lt; x; QNetworkRequest request; //QString contentType = "text/plain"; QUrl url("https://www.googleapis.com/upload/drive/v2/files?uploadType=media"); //url.addQueryItem("originalFilename","sp"); request.setUrl(url); request.setRawHeader("Content-Length","200000000"); request.setRawHeader("Content-Type","image/jpeg"); request.setRawHeader("title","sp"); //request.setRawHeader("X-Upload-Content-Length","20000000"); //request.setRawHeader("X-Upload-Content-Type","image/jpeg"); request.setRawHeader("Authorization",x.toLatin1()); //request.setRawHeader("Host","https://www.googleapis.com"); qDebug() &lt;&lt; getValue(data,"access_token").toUtf8(); //request.setRawHeader() QFile file("/home/saurabh/Pictures/005.jpg"); //file.setFileName("kashmir"); file.open(QIODevice::ReadOnly); QByteArray arr = file.readAll(); file.close(); qDebug() &lt;&lt; "file"; QString str = "a"; str.append(arr); qDebug() &lt;&lt; str; m_netM = new QNetworkAccessManager; QObject::connect(m_netM, SIGNAL(finished(QNetworkReply *)), this, SLOT(uploadfinishedSlot(QNetworkReply *))); m_netM-&gt;post(request,arr); } </code></pre> <p>I know I have to set title field for giving name to file but am not able to figure out how I would do it in qt</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload