Open augustogoncalves opened 6 years ago
We had this issue using the ObjectsApi#uploadObject
method. The issue was related with line #137 on ApiClient file, trying to convert the body(file) to JSON.
I encountered the same problem. The documentation specify passing the file path to the uploadObject()
function. When you do this, it does not attempt to json_encode
it in line 136, since it's a string, but the upload times out with a 504 response, since the specified payload size is bigger than the actual content sent. The work around I implemented was changing line #196 from:
curl_setopt($curl, CURLOPT_POSTFIELDS, $postData);
to:
curl_setopt($curl, CURLOPT_POSTFIELDS, file_get_contents($postData));
When is this going to be fixed? It's a small patch right. Still having trouble with this!
I can make a pull request if needed, or is this problem bigger then that single line?
Unfortunately, we are no longer maintaining this SDK. If you send a PR, we would be happy to merge it.
@ido567 That's too bad, well I fixed it with https://github.com/cweagans/composer-patches (for others having this problem). If I have some time I will send a PR. Thanks anyway! ;)
@MelleDijkstra If you are still using this ;)
It seems it is just the parameter suggestion in the docblock is wrong, uploadObject does not need a SplFileObject but just the file content is fine.
@tuimz Ahh, so a patch wasn't actually needed just pass file_get_contents()
straight into the function. well... the patch works anyways 😋. Thanks!
Hi @augustogoncalves I have submitted a PR wich resolves this issue. Could you take a look?
@tuimz Thanks for your PRs, I will help Augusto to maintain the SDK, I am checking your PR but my access seems not enough to approve that, working on that now.
This bug is still present... I also had to insert following lines to get rid of a http 504 error:
curl_setopt($curl, CURLOPT_FORBID_REUSE, 1);
curl_setopt($curl, CURLOPT_ENCODING , "");
The 504 problem still occurs, how can I solve it?
It seems it's converting the body/file and causing error 504