七牛 空间的图片文件 是否可以重命名 C#版 比如 空间: B1, 图片的key = old.jpg, 我要把 key 重命名为 new.jpg 不是先复制一份到new.jpg,然后再删除 old.jpg
参考:http://developer.qiniu.com/docs/v6/sdk/csharp-sdk.html#rs-move 移动单个文件 //example /// /// 移动单个文件 /// /// 需要移动的文件所在的空间名 /// 需要移动的文件 /// 目标文件所在的空间名 /// 目标文件key public static void Move(string bucketSrc, string keySrc, string bucketDest, string keyDest) { Console.WriteLine("\n===> Move {0}:{1} To {2}:{3}", bucketSrc, keySrc, bucketDest, keyDest); RSClient client = new RSClient(); new EntryPathPair(bucketSrc, keySrc, bucketDest, keyDest); CallRet ret = client.Move(new EntryPathPair(bucketSrc, keySrc, bucketDest, keyDest)); if (ret.OK) { Console.WriteLine("Move OK"); } else { Console.WriteLine("Failed to Move"); } }
参考:http://developer.qiniu.com/docs/v6/sdk/csharp-sdk.html#rs-move
移动单个文件
//example
///
/// 移动单个文件
///
/// 需要移动的文件所在的空间名
/// 需要移动的文件
/// 目标文件所在的空间名
/// 目标文件key
public static void Move(string bucketSrc, string keySrc, string bucketDest, string keyDest)
{
Console.WriteLine("\n===> Move {0}:{1} To {2}:{3}",
bucketSrc, keySrc, bucketDest, keyDest);
RSClient client = new RSClient();
new EntryPathPair(bucketSrc, keySrc, bucketDest, keyDest);
CallRet ret = client.Move(new EntryPathPair(bucketSrc, keySrc, bucketDest, keyDest));
if (ret.OK)
{
Console.WriteLine("Move OK");
}
else
{
Console.WriteLine("Failed to Move");
}
}