/// <summary> /// 获得文件下载链接 /// </summary> /// <param name="fileName">文件名</param> /// <returns></returns> public static string Download(string fileName) { string baseUrl = GetPolicy.MakeBaseUrl(_domain, fileName); string privateUrl = GetPolicy.MakeRequest(baseUrl); return(privateUrl); }
public void MakeRequestTest() { string url = GetPolicy.MakeBaseUrl("qiniuphotos.qiniudn.com", "gogopher.jpg"); // TODO: 初始化为适当的值 string actual = Exif.MakeRequest(url); ExifRet ret = Exif.Call(actual); Assert.IsTrue(ret.OK, "MakeRequestTest Failure"); }
public void MakeBaseUrlTest() { string actual; actual = GetPolicy.MakeBaseUrl(Bucket + ".qiniudn.com", LocalKey); //System.Diagnostics.Process.Start(actual); PrintLn(actual); Assert.IsTrue(!string.IsNullOrEmpty(actual), "GetPolicyTest MakeBaseUrlTest Failure"); }
public async Task MakeRequestTest() #endif { string url = GetPolicy.MakeBaseUrl("qiniuphotos.qiniudn.com", "gogopher.jpg"); // TODO: 初始化为适当的值 string actual = Exif.MakeRequest(url); #if NET20 || NET40 ExifRet ret = Exif.Call(actual); Assert.IsTrue(ret.OK, "MakeRequestTest Failure"); #else ExifRet ret = await Exif.CallAsync(actual); Assert.True(ret.OK, "MakeRequestTest Failure"); #endif }
public string GetDownloadUrl(string fileKey, string type = "image") { string bucket; string domain; GetTokenAndDomain(type, out bucket, out domain); if (type == "video") { if (string.IsNullOrWhiteSpace(fileKey)) { return(string.Empty); } string baseUrl = GetPolicy.MakeBaseUrl(domain, fileKey); string privateUrl = GetPolicy.MakeRequest(baseUrl); return(privateUrl); } else { return(string.Format("http://{0}/{1}", domain, fileKey)); } }
/// <summary> /// 获得url地址 /// </summary> /// <returns></returns> public static string GetUrl(string key) { return(GetPolicy.MakeBaseUrl(Url, key)); }
/// <summary> /// 获取下载连接 /// </summary> /// <returns></returns> public static string MakeGetToken() { string baseUrl = GetPolicy.MakeBaseUrl(domain, key); return(GetPolicy.MakeRequest(baseUrl)); }
public static string GetPrivateThumbUrl(string domain, string bucket_name, string key) { string baseUrl = string.Format(GetPolicy.MakeBaseUrl(domain, key), bucket_name) + "?imageView2/1/w/50/h/50/q/75"; return(GetPolicy.MakeRequest(baseUrl, 3600u, null)); }
public static string GetPublicThumbUrl(string domain, string bucket_name, string key) { string format = GetPolicy.MakeBaseUrl(domain, key) + "?imageView2/1/w/50/h/50/q/75"; return(string.Format(format, bucket_name)); }
public static string GetDownloadUrlWithToken(string domain, string bucket_name, string key) { string baseUrl = string.Format(GetPolicy.MakeBaseUrl(domain, key), bucket_name); return(GetPolicy.MakeRequest(baseUrl, 3600u, null)); }
public static string GetDownloadUrl(string domain, string bucket_name, string key) { string format = GetPolicy.MakeBaseUrl(domain, key); return(string.Format(format, bucket_name)); }