CI 묻고 답하기

제목 twitpic api upload
글쓴이 당근병아리 작성시각 2011/04/25 15:23:51
댓글 : 2 추천 : 0 스크랩 : 0 조회수 : 24017   RSS
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>

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

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

도저히 안되서요 .. ㅜㅡ

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




 
 다음글 model load time 관련 질문 드립니다. (3)
 이전글 세션 삭제 후 뒤로가기 문제 (3)

댓글

변종원(웅파) / 2011/04/25 19:35:56 / 추천 0
print_r($_FILES);

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

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

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

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