1、获取要下载文件的ID
function btn_downfile() {
var rows = $("#gridTable").datagrid('getChecked');
if (rows.length == 0) {
dialogMsg("至少勾选一条数据", 1);
return false;
}
var fileIds = "";
for (var i = 0; i < rows.length; i++) {
fileIds += rows[i]["AttachmentID"] + ",";
}
fileIds = fileIds.substr(0, fileIds.length - 1);
$("#formexcel").remove();
var $form = $("<form id='formexcel' method='post' action='/HR/Employee/DownDocumentFile' style='display:none;'>");
var $input = $("<input type='hidden' name='FileIds' value='" + fileIds + "'>");
$("body").append($form);
$form.append($input);
$form.submit();
}
2、根据文件ID获取文件的请求地址
/// <summary>
/// 文件打包下载
/// </summary>
/// <param name="EmpNo">工号</param>
/// <param name="FileIds">文件ID</param>
/// <returns></returns>
[HttpPost]
public ActionResult DownDocumentFile(string EmpNo, string FileIds)
{
if (string.IsNullOrEmpty(FileIds))
{