Exemple #1
0
        public void OnPost(List <TextModel> textFile)
        {
            var guy = textFile;

            var helper = new TextUploadHelper(Configuration, token, textfile);

            helper.PostToDB(textFile);
        }
Exemple #2
0
        public async Task <IActionResult> OnPost(IFormFile avatar)
        {
            var          imageByte = avatar;
            BinaryReader br        = new BinaryReader(imageByte.OpenReadStream());

            TextModel xt = new TextModel();

            xt.AvatarOne = br.ReadBytes((int)imageByte.OpenReadStream().Length);

            var helper = new TextUploadHelper(Configuration, token, textfile);

            if (await helper.PostTextFile(xt))
            {
                return(RedirectToPage("/TextEdit"));
            }
            else
            {
                return(RedirectToPage("/Error"));
            }
        }