Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File uploading is not working on php vrersion 7.2.20 #172

Open
dilipsoni opened this issue Jul 26, 2019 · 1 comment
Open

File uploading is not working on php vrersion 7.2.20 #172

dilipsoni opened this issue Jul 26, 2019 · 1 comment

Comments

@dilipsoni
Copy link

The file upload to Podio used to work on my website, but it has stopped working. I have updated PodioFile.php with the update, and it now works again on my localhost for testing but not on the webserver. Both are running PHP 7.2.20 .
Screenshot_14

@dilipsoni
Copy link
Author

Here is my podio.php code
if (!empty($options['upload'])) {
curl_setopt(self::$ch, CURLOPT_POST, TRUE);
if(!class_exists("\CURLFile") && defined('CURLOPT_SAFE_UPLOAD')) {
curl_setopt(self::$ch, CURLOPT_SAFE_UPLOAD, FALSE);
}
curl_setopt(self::$ch, CURLOPT_POSTFIELDS, $attributes);
self::$headers['Content-type'] = 'multipart/form-data';
}

and podioFile Code
public static function upload($file_path, $file_name) {

$source = defined('PHP_MAJOR_VERSION') && PHP_MAJOR_VERSION >= 5 ? new CurlFile(realpath($file_path)) : '@'.realpath($file_path);
return self::member(Podio::post("/file/v2/", array('source' => new CurlFile(realpath($file_path)), 'filename' => $file_name), array('upload' => TRUE, 'filesize' => filesize($file_path))));

}

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

No branches or pull requests

1 participant