示例#1
0
        public string GenerateURL(string uploadPath)
        {
            if (!string.IsNullOrEmpty(Settings.Endpoint) && !string.IsNullOrEmpty(Settings.Bucket))
            {
                uploadPath = URLHelpers.URLEncodeIgnoreEmoji(uploadPath, true);

                string url;

                if (Settings.UseCustomCNAME && !string.IsNullOrEmpty(Settings.CustomDomain))
                {
                    CustomUploaderParser parser = new CustomUploaderParser();
                    string parsedDomain         = parser.Parse(Settings.CustomDomain);
                    url = URLHelpers.CombineURL(parsedDomain, uploadPath);
                }
                else
                {
                    url = URLHelpers.CombineURL(Settings.Endpoint, Settings.Bucket, uploadPath);
                }

                return(URLHelpers.FixPrefix(url, "https://"));
            }

            return("");
        }