1

I have a Kendo grid which got a link which downloads the file and it works fine on my local machine. however,After my code is being published/deployed to the server it doesn't download the file When you click.but if i manually put the root from the browser,it works below is the error server error i get

Error: 404 - File or directory not found.

I have tried reading this solution and apply on my case but it didn't work. not sure if am doing it in a wrong way.

My download link

columns.Template(@<text>
                        @Html.ActionLink(@item.ID.ToString(), "DownloadIndex", "controllerName", new { ID = @item.ID })
                        </text>)
                         .ClientTemplate("<href=/controllerName/DownloadIndex?ID=#= ID#'>Download />").Width(100)
                          .Title("Download");
Community
  • 1
  • 1
Mr Junior
  • 81
  • 2
  • 17

1 Answers1

0

After a few hours of doing research...I manage to get a solution tomy problem.

If you are working no local,by default it point to your local host which became http and you will be able to download a file, however, if you are working on server, you need to specify that it is a server "https"

Complete solution

columns.Template(@<text>
                        @Html.ActionLink(@item.ID.ToString(), "DownloadIndex", "Poss", new { ID = @item.ID })
                        </text>)
                          .ClientTemplate("<a href='" +Url.Action("DownloadIndex", "controllerName",null,"https") + "?ID=#= ID#'" + ">Downloading</a>")
        .Title("Download");    
Mr Junior
  • 81
  • 2
  • 17