Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. [HttpPost]
  2. public FileResult Download(TrainingModel pass)
  3. {
  4. return File(pass.filePath, "imagejpg", "haha.jpg");
  5. }
  6.  
  7. function fncDownloadImage(fileName)
  8. {
  9. //passes the fileName the parameter to the Model
  10. var download = {'filePath' : fileName}
  11. $.ajax({
  12. type: "POST",
  13. url: '/Capability/Download',
  14. data: JSON.stringify(download),
  15. contentType: 'application/json; charset=utf-8',
  16. success: function (response) {
  17. },
  18. error: function (XMLHttpRequest, textStatus, errorThrown) {
  19. alert(textStatus);
  20. }
  21. });
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement