Finally, sorted using:
A) To upload a file to a Client Location:
public void downloadFile(string fileName, string filePath) { Response.ContentType = "application/octet-stream"; Response.AddHeader("Content-Disposition", string.Format("attachment; filename=\"{0}\"", fileName)); Response.WriteFile(filePath + fileName); }
B) Since the function launch controls ( imgDownload
, imgDownloadPsd
) are wrapped under an asynchronous call: add this to the Download page:
protected void Page_Load(object sender, EventArgs e) { ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(imgDownload); ScriptManager.GetCurrent(this.Page).RegisterPostBackControl(imgDownloadPsd); }
source share