Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, "https://php.net/manual/pt_BR/curlfile.setmimetype.php");
- curl_setopt($ch, CURLOPT_HEADER, 0);
- curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- /*$cfile = new CURLFile("cats.jpg", "image/jpg", "test_name");
- $data = array('test_file' => $cfile);
- curl_setopt($ch, CURLOPT_POST, 0);
- curl_setopt($ch, CURLOPT_POSTFIELDS, $data);*/
- curl_exec($ch);
- if($errno = curl_errno($ch)){
- $error_message = curl_strerror($errno);
- echo("cURL error({$errno}):\n {$error_message}");
- }
- echo("<br />");
- echo(curl_unescape($ch, curl_getinfo($ch, CURLINFO_EFFECTIVE_URL)));
- echo("<br />");
- //echo(CURLFile::getFilename());
- echo("<br />");
- //echo(CURLFile::getMimeType());
- echo("<br />");
- //echo(CURLFile::getPostFilename());
- echo("<br />");
- curl_close($ch);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement