0

What does Error: chunk size has to be 500.000 or more if it is not the final chunk means when calling uploadresume method of rapidshare API. I am sending more than 500,000 bytes of data but still getting the same error.

Do i have to set some headers??

cyber_raj
  • 1,780
  • 1
  • 14
  • 25
  • How do you verify that you are sending more than 500.000 bytes of data? Also, what are you sending as value for "complete" flag? – Pavel Zdenek Aug 13 '12 at 10:08
  • i am checking with uploadProgress(qint64 bytesSent, qint64 bytesTotal) signal. After posting each time the final uploadProgress() call bytesSent is between 500.000 and 100.000.000 bytes. For final block i m setting complete=1 for others nothing, i tried with complete=0 for incomplete or not sending complete at all but to no avail. – cyber_raj Sep 03 '12 at 07:43
  • The API says that you must start with `sub=upload;incomplete=1` and then continue with `sub=uploadresume` (and optionally `incomplete=1`) too. Are you doing it this way? Do you check for `INCOMPLETE` being returned upon the first `sub=upload` call? Do you provide the resulting `fileid` correctly to the further calls? – Pavel Zdenek Sep 03 '12 at 14:14
  • yes i m starting with **sub=upload;incomplete=1** and i am getting **INCOMPLETE** and **fileID=xxx** in response and partial file data gets uploaded. After that i continue with **sub=uploadresume** and same **fileid=xxx** and i call this multiple times until whole file data gets uploaded but in first response to **uploadresume** i am getting **Error:** response. I tried with **incomplete=1** in **sub=uploadresume** but same response. For all this i am using post method that takes a qbytearray as argument. – cyber_raj Sep 04 '12 at 09:06
  • Also when continuing with sub=uploadresume i am setting request header as follows request.setHeader(QNetworkRequest::ContentTypeHeader, "multipart/form-data"); otherwise i am getting Error response bad gateway. If i am not setting this header at all or setting it with some other MIME type like application/x-www-form-urlencoded i am getting Bad gateway response. – cyber_raj Sep 04 '12 at 12:28
  • Why `multipart/form-data`, or even `application/x-www-form-urlencoded` ?? You are sending binary stream, not a html form, aren't you? Have you tried without MIME type? Or if you need some (RapidShare API doesn't mention any such requirement) i bet for `application/octet-stream` – Pavel Zdenek Sep 04 '12 at 12:51
  • With application/octet-stream the response is same - "Bad Gateway". Without MIME type too the response is same - "Bad gateway" – cyber_raj Sep 04 '12 at 13:23

0 Answers0