Guest User

Untitled

a guest
May 7th, 2012
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. cURL is not able to upload file on scribd
  2. <?php
  3. $ch = curl_init();
  4. curl_setopt($ch, CURLOPT_HEADER, 0);
  5. curl_setopt($ch, CURLOPT_VERBOSE, 0);
  6. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  7. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
  8. curl_setopt($ch, CURLOPT_URL, _'http://www.scribd.com/upload/supload');
  9. curl_setopt($ch, CURLOPT_POST, true);
  10. // same as <input type="file" name="file_box">
  11. $post = array(
  12. $path=getcwd(); //absolute path
  13. $post = array(
  14. "file"=>"@".$path."/test.txt",
  15. );
  16. curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
  17. $response = curl_exec($ch);
  18. ?>
  19.  
  20. $response = curl_exec($ch);
  21. if ($response === false) {
  22. die(curl_error($ch));
  23. }
Advertisement
Add Comment
Please, Sign In to add comment