1
원격 파일에서 Cloud Files Container로 파일을로드하려고합니다. 다음은 cloudfiles 원격 파일 문제
는 클라우드 파일 지원 사람이 내게 준 예제 코드입니다 :<?php
require('cloud/cloudfiles.php');
$res = fopen("http://images.piccsy.com/cache/images/66653-d71e1b-320-469.jpg", "rb");
$temp = tmpfile();
$size = 0.0;
while (!feof($res))
{
$bytes = fread($res, 1024);
fwrite($temp, $bytes);
$size += (float) strlen($bytes);
}
fclose($res);
fseek($temp, 0);
//
$auth = new CF_Authentication('user','token ');
//Calling the Authenticate method returns a valid storage token and allows you to connect to the CloudFiles Platform.
$auth->authenticate();
$conn = new CF_Connection($auth);
$container = $conn->create_container("example");
$object = $container->create_object("example.jpg");
$object->content_type = "image/jpeg";
$object->write($temp, $size);
fclose($temp);
?>
내가 점점 오전 문제는 아래의 오류입니다 :
Fatal error: Call to a member function create_container() on a non-object in /home2/sharingi/public_html/daily_dose/remote_test.php on line 24
확실하지 정확히 내가 여기에 몰래하고있는 무슨 .
'cloudfiles.php'에 있어야하며 'CF_Auth'는 전에 오류가있는 것 같습니까? – ian
@ian 다시 확인하십시오. 때로는 가정이 잘못되었습니다. :) – alex
'var_dump'가'Notice : Undefined variable : conn /home2/sharingi/public_html/daily_dose/remote_test.php 5 행에 있습니다. bool (false)'와'error_reporting'는 을 반환합니다. 알림 : 정의되지 않은 오프셋 : 8 in /home2/sharingi/public_html/daily_dose/cloud/cloudfiles.php on line 1588' – ian