podio-php
podio-php copied to clipboard
Podio file upload giving error
I have 2 servers one is .in while other is .com. On uploading the png file on .in runs perfectly but not on another. What could be the reason? Below is the error I am getting.
Uncaught PodioConnectionError: Connection to Podio API failed: [92]
While on this same server .com I am able to get other API calls such as get items in-app, get Items. Only on file uploading, I am getting this error.
Then I even tried using curl API as given in api doc.
`$k=file_get_contents('files/download.jpg'); $str=array("source"=>$k,"filename"=>"download.jpg"); $data=json_encode($str,JSON_PRETTY_PRINT); //echo $k; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,"https://api.podio.com/file?oauth_token=b21ee70692094c3b97r4tr8t5fjdjerre"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); curl_setopt($ch, CURLOPT_POST, TRUE); curl_setopt($ch, CURLOPT_POSTFIELDS,"source=".$k."&filename=download.jpg"); //curl_setopt($ch, CURLOPT_POSTFIELDS,'{"source":'.$k.',"filename":"test.jpg"}'); $headers= array(); $headers[]= 'Content-Type: multipart/form-data'; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$response = curl_exec($ch); curl_close($ch); $r = json_decode ($response,true); print_r($r);`
Error
{ "error_parameters": {}, "error_detail": null, "error_propagate": false, "request": { "url": "http://api.podio.com/file", "query_string": "oauth_token=b21ee70692094c3b97r4tr8t5fjdjerre", "method": "POST" }, "error_description": "An unexpected error occured during execution", "error": "unexpected" }
But not succeeded. Any help will be much appreciated.
This does not look like an lib related issue you should try to contact podio support directly.
Hello did you found out solution? i am facing same problem
No I still haven’t resolved this issue.
On Tue, 26 Mar 2019 at 10:08, talhaghaffar92 [email protected] wrote:
Hello did you found out solution? i am facing same problem [image: Screen Shot 2019-03-26 at 2 06 21 AM] https://user-images.githubusercontent.com/20902548/54954235-fca0c380-4f6b-11e9-898d-6b33a9853efc.png
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/podio-community/podio-php/issues/154#issuecomment-476378058, or mute the thread https://github.com/notifications/unsubscribe-auth/ATqgX3-s0L1_qrT6Wr-toI-aOzjVb674ks5vaTq8gaJpZM4blS1- .
@talhaghaffar92 Can you please share some code snippet which is giving the error?
I'm having the same issue during upload. According to cURL its: curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) I've changed podio-php to force use of HTTP1.1 and it works.
I've done some research and it seems most likely that the problem lies on podio's end.
BTW I'm running php 7.3.6 with cURL 7.64.0.
Is there another way to apply this changes without tweaking the library? like options or something similar
I'm having the same issue during upload. According to cURL its: curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1) I've changed podio-php to force use of HTTP1.1 and it works.
I've done some research and it seems most likely that the problem lies on podio's end.
BTW I'm running php 7.3.6 with cURL 7.64.0.
How did you manage to force HTTP1.1 in podio ?