Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [Authorize]
- public async Task<IActionResult> Index(int clientId, string error)
- {
- // ....... Removed
- var model = new SecretIndexModel()
- {
- Client = clients.Client,
- ErrorMessage = error
- };
- return View(model);
- }
- [Authorize]
- [HttpPost]
- public async Task<IActionResult> Add(SecretIndexModel model)
- {
- /// removed ....
- return DownloadDocument("results json string");
- }
- public FileResult DownloadDocument(string id)
- {
- var ms = new MemoryStream(System.Text.Encoding.ASCII.GetBytes("abc"));
- return File(ms, System.Net.Mime.MediaTypeNames.Application.Octet, "secret.json");
- }
- return RedirectToAction("Index",
- new
- {
- clientId = model.Client.Id,
- error = (client.Errors == null)
- ? string.Empty
- : client?.Errors?.FirstOrDefault()?.Message
- });
Add Comment
Please, Sign In to add comment