Guest User

Untitled

a guest
Jan 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. $url = 'https://api.example.com/upload';
  2. $ch = curl_init();
  3. curl_setopt($ch, CURLOPT_URL, $url);
  4. curl_setopt($ch, CURLOPT_POST, 1);
  5. curl_setopt($ch, CURLOPT_SAFE_UPLOAD, false);
  6. //file url
  7. $file ='http://www.example1.com/ex.zip';
  8. // I need here something to work with file url
  9. curl_setopt($ch, CURLOPT_POSTFIELDS, $file);
  10. //--------------
  11. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  12. curl_setopt($ch, CURLOPT_HTTPHEADER, array(
  13. 'X-AS24-Version: 1.1',
  14. 'Accept-Language: en-GB',
  15. 'Content-type: multipart/form-data',
  16. 'Authorization: Bearer ' . $access_token
  17. ));
  18. $output = curl_exec($ch);
  19. curl_close($ch);
  20. return $output;
Add Comment
Please, Sign In to add comment