请问上传中文标题乱码的问题
cs端:
String FileName = textBox2.Text;
try
{
if (FileName !="")
{ //文件上传,服务器端接收
myWebClient.UploadFile(ServerUrl, "POST", FileName);
MessageBox.Show(" 上传成功 ");
}
服务器端:ashx:
public class Uploader : IHttpHandler
{
public void ProcessRequest(HttpContext hc)
{
foreach (string fileKey in hc.Request.Files)
{
HttpPostedFile file = hc.Request.Files[fileKey];
file.SaveAs(Path.Combine(hc.Server.MapPath("./"), file.FileName));
}
}
public bool IsReusable
{
get { return true; }
}
}
症状:传上去,如果是中文文件名的话,显示乱码.
请问我如何转换下,正常显示。
String FileName = textBox2.Text;
try
{
if (FileName !="")
{ //文件上传,服务器端接收
myWebClient.UploadFile(ServerUrl, "POST", FileName);
MessageBox.Show(" 上传成功 ");
}
服务器端:ashx:
public class Uploader : IHttpHandler
{
public void ProcessRequest(HttpContext hc)
{
foreach (string fileKey in hc.Request.Files)
{
HttpPostedFile file = hc.Request.Files[fileKey];
file.SaveAs(Path.Combine(hc.Server.MapPath("./"), file.FileName));
}
}
public bool IsReusable
{
get { return true; }
}
}
症状:传上去,如果是中文文件名的话,显示乱码.
请问我如何转换下,正常显示。
...全文
相关推荐
smartupload上传里中文无乱码
smartupload上传里中文无乱码,方便解决乱码问题
jquery fileupload上传百分比 JAVA版解决中文乱码
NULL 博文链接:https://vtedndx.iteye.com/blog/1314460
wordpress 上传附件中文文件名乱码解决办法(for Windows)
我的开发工作是在Mac OS X下进行的,而wordpress又是UTF-8编码,在新版本(我用都是3.0.3)的wordpress中上传中文附件可以正常存储和显示、下载
php多文件上中文无乱码
php多文件上传中文无乱码,上传速度快,采用jquery上传组件,稳定快速。
smartupload多文件上传解决中文乱码
smartupload是一个很好的文件上传工具,就是中文文件乱码。我已经解决了中文乱码的问题!一个多文件上传的例子,使用了smartupload。上传后的文件名返回给父页面!


