コード例 #1
0
ファイル: AiurUploader.cs プロジェクト: wangyaoDgit/Nexus
        public async Task <IViewComponentResult> InvokeAsync(
            string aspFor,
            string siteName,
            string path,
            int sizeInMb,
            string defaultFile,
            string allowedExtensions)
        {
            var accessToken = ViewBag.AccessToken as string ?? await _appsContainer.AccessToken();

            var token = await _tokenService.GetUploadTokenAsync(accessToken, siteName, "Upload", path);

            var model = new AiurUploaderViewModel
            {
                Name              = aspFor,
                PBToken           = token,
                Path              = path,
                SiteName          = siteName,
                SizeInMB          = sizeInMb,
                DefaultFile       = defaultFile,
                AllowedExtensions = allowedExtensions
            };

            return(View(model));
        }
コード例 #2
0
ファイル: AiurUploader.cs プロジェクト: supeng222/Nexus
        public async Task <IViewComponentResult> InvokeAsync(
            string aspFor,
            string siteName,
            string path,
            int sizeInMb,
            string defaultFile,
            string allowedExtensions)
        {
            var token = await GetUploadToken(siteName, path);

            var model = new AiurUploaderViewModel
            {
                Name              = aspFor,
                PBToken           = token,
                Path              = path,
                SiteName          = siteName,
                SizeInMB          = sizeInMb,
                DefaultFile       = defaultFile,
                AllowedExtensions = allowedExtensions
            };

            return(View(model));
        }