Skip to content
This repository has been archived by the owner on Sep 17, 2024. It is now read-only.

uploadObject method not working #10

Open
augustogoncalves opened this issue Jul 20, 2017 · 11 comments
Open

uploadObject method not working #10

augustogoncalves opened this issue Jul 20, 2017 · 11 comments

Comments

@augustogoncalves
Copy link
Contributor

It seems it's converting the body/file and causing error 504

@luiztiago
Copy link

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.

@hishamyounis
Copy link

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));

@melledijkstra
Copy link

melledijkstra commented Jan 4, 2018

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?

@ido567
Copy link
Contributor

ido567 commented Jan 7, 2018

Unfortunately, we are no longer maintaining this SDK.
If you send a PR, we would be happy to merge it.

@melledijkstra
Copy link

@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! ;)

@tuimz
Copy link
Contributor

tuimz commented May 16, 2018

@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.

@melledijkstra
Copy link

@tuimz Ahh, so a patch wasn't actually needed just pass file_get_contents() straight into the function. well... the patch works anyways 😋. Thanks!

@tuimz
Copy link
Contributor

tuimz commented May 22, 2018

Hi @augustogoncalves I have submitted a PR wich resolves this issue. Could you take a look?

@JohnOnSoftware
Copy link
Collaborator

@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.

JohnOnSoftware added a commit that referenced this issue Jun 6, 2018
Fixed docblocks to prevent things as reported in #10 from happening
JohnOnSoftware added a commit that referenced this issue Jun 6, 2018
Fixed docblocks to prevent things as reported in #10 from happening
@swalter88
Copy link

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 , "");

@Dshufeng
Copy link

The 504 problem still occurs, how can I solve it?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants