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需要一個本地路徑字符串,但項目被聲明爲字節[]。 我可以使用變量而不是本地路徑嗎?