-
-
Save evsapi/2697499 to your computer and use it in GitHub Desktop.
IDrive - EVS - REST API - downloadFile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $webApiServer = "[path to server from previous getServerAddress]"; | |
| $uid = "[your user]"; | |
| $pwd = "[your password]"; | |
| $crtpath = '[path to your local cert for curl calls]'; | |
| $localfilepath = '[Your download file path]'; | |
| $pvtkey = '[your private key]'; | |
| // file | |
| $PostFields = array( | |
| 'uid' => $uid, | |
| 'pwd' => $pwd, | |
| 'p' => $localfilepath, | |
| 'pvtkey' => $pvtkey, | |
| 'version' => '1', | |
| 'thumbnail_type' => 'S', | |
| 'trash' => 'no' | |
| ); | |
| $ch = curl_init(); | |
| $url = "https://" . $webApiServer. "/evs/downloadFile "; | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
| // POST | |
| curl_setopt($ch, CURLOPT_POST, true); | |
| curl_setopt($ch, CURLOPT_POSTFIELDS, $PostFields); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data')); | |
| // SSL | |
| curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,FALSE); | |
| curl_setopt($ch,CURLOPT_CAINFO,$crtpath); | |
| // Output | |
| $output = curl_exec($ch); | |
| curl_close($ch); | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment