Closed cristeab closed 7 years ago
I have found the problem: when building the request data only 'photo' should be put there, all other params are optional and should be signed.
So postData should be constructed as
requestData += QString("--" HTTP_PART_BOUNDARY "\r\n").toUtf8();
requestData += "Content-Disposition: form-data; name=\"photo\"; filename=\""+
fileInfo.fileName()+"\"\r\n";
QMimeDatabase db;
QMimeType mimeType = db.mimeTypeForFile(filename);
requestData += "Content-Type: "+mimeType.name()+"\r\n";
requestData += "\r\n"+file.readAll()+"\r\n";
file.close();
requestData += QString("--" HTTP_PART_BOUNDARY "--\r\n").toUtf8();
Hi
I am trying to use o2 library to upload photos to flickr. Authentication process goes well, but I am unable to upload a photo. The error says: "Error when uploading file: authentication required"
I am sending a photo with
postData is a QbyteArray constructed as shown below:
Could someone tell me what I am doing wrong ?
thanks Bogdan