public void MyTestMethod() { var filepath = Path.Combine(Environment.CurrentDirectory, "test.pdf"); Console.WriteLine(filepath); Assert.IsTrue(File.Exists(filepath)); var bytes = File.ReadAllBytes(filepath); var ret = _client.FileGetUploadUrl(new FileGetUploadUrlRequest() { ContentMd5 = Md5Utils.Md5Base64(bytes), FileName = "test.pdf", FileSize = bytes.LongLength }).Result; WriteJson(ret); var ret1 = _client.FileUpload(ret.Data.UploadUrl, bytes).Result; WriteJson(ret1); }
public void FileMd5Test() { var ret = Md5Utils.Md5Base64("0123456789"); Assert.AreEqual("eB5eJF1ptWaXm4bijSPyxw==", ret); }