질문 Q #9296
twitpic api upload
당근병아리 2011-04-25 15:23:51
http://brandonbeasley.com/blog/twitpic-api-codeigniter-php-library/

로 사용중입니다.^^;;      

 $this->load->library('twitpic', array('api_key' => '')); //Enter Twitpic API key here
 
        
        $config['http_auth'] = "BASIC";
        $config['http_user'] ="";
        $config['http_pass'] = "";
        
        $this->twitpic->initialize($config);
        $params = array(
         'key'=> '',
     'message'=> 'twitpic 테스트' ,
         'media' => '@'.$_FILES['media']
        ) ;
        $url ="upload.xml";
        $format = "xml";
        
     $this->twitpic->post($url,$params,$format);

이렇게 업로드하며 안됩니다. ^^;

=============================================

REST Test

=============================================

Request

http://api.twitpic.com/2/upload.xml
=============================================

Response

<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>
<code>400</code>
<message>Bad Request. Media not included in POST payload.</message>
</error>
</errors>

=============================================

이런 메세지가 나옵니다...

도저히 안되서요 .. ㅜㅡ

혹시아시는 분 있으시나요..




 
답변 2
#1 변종원(웅파) 2011-04-25 19:35:56
print_r($_FILES);

파일이름이 media가 맞는지 확인을...
#2 헛발이 2011-04-25 22:24:39
저도 연습삼아서 해 봤는데요.. 에라가 똑같이 나네요..
저는 이렇게 나는데요..

Array
(
    [error] => SimpleXMLElement Object
        (
            [code] => 400
            [message] => Bad Request. Media not included in POST payload.
        )
)

혹시 심플XML을 못 쓰는 환경 아닌가요? 저도 카페24환경이여서 SimpleXML이 안되는 환경이거든요..

SimpleXML되는 호스팅업체 없나요?