
Untitled
By: a guest on
May 7th, 2012 | syntax:
None | size: 0.72 KB | hits: 11 | expires: Never
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));
}