public static void RSClientPutFileWithCRC32() { Console.WriteLine("\n===> RSClientPutFileWithCRC32 Generate CRC32"); UInt32 crc = CRC32.CheckSumFile(localFile); Console.WriteLine("CRC32: " + crc.ToString()); Console.WriteLine("\n===> RSClientPutFileWithCRC32 Generate UpToken"); var authPolicy = new AuthPolicy(bucketName, 3600); string upToken = authPolicy.MakeAuthTokenString(); Console.WriteLine("upToken: " + upToken); Console.WriteLine("\n===> RSClient.PutFileWithUpToken(CRC32)"); PutFileRet putFileRet = RSClient.PutFileWithUpToken(upToken, bucketName, key, null, localFile, null, "key=<key>", crc); PrintRet(putFileRet); if (putFileRet.OK) { Console.WriteLine("Hash: " + putFileRet.Hash); } else { Console.WriteLine("Failed to RSClient.PutFileWithUpToken(CRC32)"); } }
public static void ResumablePutFile() { Console.WriteLine("\n===> ResumablePut.PutFile"); var authPolicy = new AuthPolicy(bucketName, 3600); string upToken = authPolicy.MakeAuthTokenString(); PutAuthClient client = new PutAuthClient(upToken); PutFileRet putFileRet = ResumablePut.PutFile(client, bucketName, bigkey, null, bigFile, null, "key=<key>"); PrintRet(putFileRet); if (putFileRet.OK) { Console.WriteLine("Hash: " + putFileRet.Hash); } else { Console.WriteLine("Failed to ResumablePut.PutFile"); } }
public static void RSClientPutFile() { Console.WriteLine("\n===> RSClient Generate UpToken"); var authPolicy = new AuthPolicy(bucketName, 3600); string upToken = authPolicy.MakeAuthTokenString(); Console.WriteLine("upToken: " + upToken); Console.WriteLine("\n===> RSClient.PutFileWithUpToken"); PutFileRet putFileRet = RSClient.PutFileWithUpToken(upToken, bucketName, key, null, localFile, null, "key=<key>"); PrintRet(putFileRet); if (putFileRet.OK) { Console.WriteLine("Hash: " + putFileRet.Hash); } else { Console.WriteLine("Failed to RSClient.PutFileWithUpToken"); } }