[英]Why does Request.QueryString[“path”] converts all + signs to spaces?
我有这样的JavaScript代码:
function OnRequestComplete(result) {
// Download the file
//Tell browser to open file directly
alert(result);
var requestImage = "Handler.ashx?path=" + result;
document.location = requestImage;
}
和Handler.ashx代码是这样的:
public void ProcessRequest(HttpContext context)
{
Context = context;
string filePath = context.Request.QueryString["path"];
filePath = context.Server.MapPath(filePath);
}
在filePath中,我们没有任何+号(而是空格)。
我该如何解决这个问题?
为什么Request.QueryString [“ path”]会将所有+符号转换为空格?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.