Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [HttpPost]
- public FileResult Download(TrainingModel pass)
- {
- return File(pass.filePath, "imagejpg", "haha.jpg");
- }
- function fncDownloadImage(fileName)
- {
- //passes the fileName the parameter to the Model
- var download = {'filePath' : fileName}
- $.ajax({
- type: "POST",
- url: '/Capability/Download',
- data: JSON.stringify(download),
- contentType: 'application/json; charset=utf-8',
- success: function (response) {
- },
- error: function (XMLHttpRequest, textStatus, errorThrown) {
- alert(textStatus);
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement