[英]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.