17 Ekim 2014, 16:00 | #1 | |
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0) | Curl Ile Twitpic.com Sitesine Resim Upload Etmek $file = $_FILES['media']; if (!in_array($file['type'], array('image/png','image/jpeg','image/gif'))) { echo '<span style="color:#CC0000;">Not a valid file type, please upload PNG, JPEG or GIF images only.</span>'; exit; } $postfields = array(); $postfields['username'] = $username; $postfields['password'] = $password; $postfields['media'] = "@$file['tmp_name']"; $twitter_url = 'http://twitpic.com/api/upload'; $curl = curl_init(); curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_BINARYTRANSFER, 1); curl_setopt($curl, CURLOPT_URL, $twitter_url); curl_setopt($curl, CURLOPT_POST, 3); curl_setopt($curl, CURLOPT_POSTFIELDS, $postfields); $result = curl_exec($curl); curl_close($curl); $login_xml = new SimpleXMLElement($result); if (isset($login_xml->error)) { print_r($login_xml); } else { print_r($login_xml); }
__________________ | |
|
Etiketler |
curl, etmek, ile, resim, sitesine, twitpiccom, upload |
Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir) | |
| |
Benzer Konular | ||||
Konu | Konuyu Başlatan | Forum | Cevaplar | Son Mesaj |
American Curl Kedisi, American Curl Kedisinin Özellikleri | Violent | Evcil Kediler | 0 | 08 Mart 2014 21:44 |
GW | cURL Nedir ? Ne İşe Yarar ? cURL e Giriş | cURL İle Post İşlemleri | SeckiN | PHP | 0 | 19 Ağustos 2013 22:33 |