1
Rackspace云文件,PutStorageItem方法被声明为取本地文件路径,我可以使用变量吗? (字符串容器名称,字符串localFilePath);以byte []变量而不是直接本地文件路径?
API PutStorageItem(string ContainerName,string localFilePath);
我的方法声明为
UploadItem(string username, string apiKey, string ContainerName, byte[] Item)
{
UserCredentials userCredentials = new UserCredentials(new Uri("https://auth.api.rackspacecloud.com/v1.0"), username, apiKey, null, null);
Connection connection = new com.mosso.cloudfiles.Connection(userCredentials);
connection.PutStorageItem(ContainerName, Item); //<--- X here
}
正如你所看到的,PutStorageItem需要一个本地路径字符串,但项目被声明为字节[]。 我可以使用变量而不是本地路径吗?