Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
geek-at committed May 12, 2022
2 parents 45b2e11 + 6ad94f2 commit 96e73e2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions rtfm/INTEGRATIONS.md
Expand Up @@ -107,4 +107,36 @@ process {
}
}
end {}
# PHP
```php
/*
* @param $path string Path to the file that should be uploaded
* @param $hash string Optional. File name we want on pictshare for the file
*/
function pictshareUploadImage($path,$hash=false)
{
if(!file_exists($path)) return false;
$request = curl_init('https://pictshare.net/api/upload.php');
curl_setopt($request, CURLOPT_POST, true);
curl_setopt(
$request,
CURLOPT_POSTFIELDS,
array(
'file' => curl_file_create($path),
'hash'=>$hash
));
// output the response
curl_setopt($request, CURLOPT_RETURNTRANSFER, true);
$json = json_decode(curl_exec($request).PHP_EOL,true);
// close the session
curl_close($request);
return $json;
}
```

0 comments on commit 96e73e2

Please sign in to comment.