Skip to content Skip to sidebar Skip to footer

Redirect Response To Download File

I have a generic handler that I call using this very basic js code: var formData = new FormData(); formData.append('fileId', this.model.get('id')); xhr = new XMLHttp

Solution 1:

That won't start a download in the browser. It's difficult to achieve using a POST request. Can it not be a GET request if you are only passing an id? Then you just do

document.location.href = '/genericHandlers/DownloadFile.ashx?id=' + this.model.get("id");

Post a Comment for "Redirect Response To Download File"