Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cURL is not able to upload file on scribd
- <?php
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_VERBOSE, 0);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)");
- curl_setopt($ch, CURLOPT_URL, _'http://www.scribd.com/upload/supload');
- curl_setopt($ch, CURLOPT_POST, true);
- // same as <input type="file" name="file_box">
- $post = array(
- $path=getcwd(); //absolute path
- $post = array(
- "file"=>"@".$path."/test.txt",
- );
- curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
- $response = curl_exec($ch);
- ?>
- $response = curl_exec($ch);
- if ($response === false) {
- die(curl_error($ch));
- }
Advertisement
Add Comment
Please, Sign In to add comment