示例#1
0
        public async Task <string> UploadSuggestionImageAsync(Cloudinary cloudinary, IFormFile file)
        {
            var isImage = ImageExtensions.IsImage(file);

            if (!isImage)
            {
                return(null);
            }

            var url = await this.UploadAsync(cloudinary, file);

            return(url);
        }
示例#2
0
        public async Task <string> UploadGuideImageAsync(Cloudinary cloudinary, IFormFile file)
        {
            if (file == null)
            {
                var defaultUrl = GlobalConstants.DefaultGuideImage;

                return(defaultUrl);
            }

            var isImage = ImageExtensions.IsImage(file);

            if (!isImage)
            {
                var defaultUrl = GlobalConstants.DefaultGuideImage;

                return(defaultUrl);
            }

            var url = await this.UploadAsync(cloudinary, file);

            return(url);
        }