Php cloudfiles简单地上传图像
我使用的是PHP,我有一个图像位于与我的PHP文件相关的Php cloudfiles简单地上传图像,php,Php,我使用的是PHP,我有一个图像位于与我的PHP文件相关的image/tomato.png 我已经设法获得了我的cloudfile容器列表,因此我知道我的rackspace身份验证工作正常 问:如何使用PHP将图像文件上载到rackspace cloudfiles容器'phpx'?github上有一个简单的用于PHP的cloudfiles API绑定-> 示例用法: <?php // include the API require('cloudfiles.php'); // cloud
image/tomato.png
我已经设法获得了我的cloudfile容器列表,因此我知道我的rackspace身份验证工作正常
问:如何使用PHP将图像文件上载到rackspace cloudfiles容器
'phpx'
?github上有一个简单的用于PHP的cloudfiles API绑定->
示例用法:
<?php
// include the API
require('cloudfiles.php');
// cloud info
$username = ""; // username
$key = ""; // api key
// Connect to Rackspace
$auth = new CF_Authentication($username, $key);
$auth->authenticate();
$conn = new CF_Connection($auth);
// Get the container we want to use
$container = $conn->get_container('container name');
// store file information
$localfile = <filepath>;
$filename = <filename>;
// upload file to Rackspace
$object = $container->create_object($filename);
$object->load_from_filename($localfile);
?>
谢谢你,曼苏克。我能问一下你是从哪里找到这个例子的吗?