请求文件下载URL过长处理
/*
* PostNewWin
* Author:ppchen
*/
var PostNewWin = function(url){
var urlArr = url.split("?");
var postUrl = urlArr[0];
var postData = urlArr[1];
var iframe = document.getElementById("postData_iframe");
if(!iframe){
iframe = document.createElement("iframe");
iframe.id = "postData_iframe";
iframe.scr= "about:blank";
iframe.frameborder = "0";
iframe.style.width = "0px";
iframe.style.height = "0px";
var form = document.createElement("form");
form.id = "postData_form";
form.method = "post";
form.target = "_blank";
document.body.appendChild(iframe);
iframe.contentWindow.document.write("<body>" + form.outerHTML + "</body>");
}
iframe.contentWindow.document.getElementById("postData_form").innerHTML = "<input name='postData' id='postData' type='text' value='" + postData + "'/>";
iframe.contentWindow.document.getElementById("postData_form").action = postUrl;
iframe.contentWindow.document.getElementById("postData_form").submit();
};
/// <summary>
/// 从Form中取得参数
/// Author:ppchen
/// </summary>
/// <returns>参数集合</returns>
private NameValueCollection ParseFormData()
{
NameValueCollection sQueryString = new NameValueCollection();
if (this.Request.Form.Count > 0 && this.Request.Form["postData"] != null)
{
string sPostData = this.Request.Form["postData"].ToString();
sPostData = sPostData.Trim(new char[] { '&', ' ' });
if (!string.IsNullOrEmpty(sPostData))
{
string[] sParameterList = sPostData.Split('&');
for (int i = 0; i < sParameterList.Length; i++)
{
string[] sParameter = sParameterList[i].Split('=');
for (int j = 0; j < sParameter.Length; j = j + 2)
{
sQueryString.Add(sParameter[j], HttpUtility.UrlDecode(sParameter[j + 1]));
}
}
}
}
return sQueryString;
}