一个文件上传中的unicode编码中文乱码问题
代码如下:使用得无组件上传
article_add.ASP
<html>
<head>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<link href="ad.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#DDEEFF">
<form name="form1" method="post" action="article_add1.asp" enctype="multipart/form-data" >
<tr>
<td height="26" width="176"></td>
<td height="26" width="363"><input name="Art_Title" type="text" size="60"></td>
</tr>
<tr> <td height="26" width="176"></td>
<td height="26" width="363"><input name="file1" type="file" size="60" ID=Text1></td>
</tr>
<tr>
<td colspan="2" height="28" width="540">
<div align="center">
<p> <input type="submit" name="Submit" value="up">
<input type="reset" name="Submit2" value="vv">
</p>
</div>
</td>
</tr>
</table>
</form>
article_add1.ASP
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<!--#include FILE="include/upload_5xsoft.inc"-->
<%
dim upload,file,formName,formPath,iCount,sql,Art_ClassID,Art_Title,Art_Abstract,Art_Content,action,pic
set upload=new upload_5xSoft
formPath="./"
for each formName in upload.file
set file=upload.file(formName)
if file.FileSize>0 then
pic=year(Now())&month(Now())&day(Now())&hour(Now())&minute(Now())&second(Now())&right(file.FileName,4)
file.SaveAs Server.mappath(formPath&pic)
response.write file.FilePath&file.FileName&" ("&file.FileSize&") => "&formPath&File.FileName&" <br>"
end if
set file=nothing
next
response.write Replace(upload.form("Art_Title"),"'","''")
%>
问题出现在,当文本框或者文件名 是 奇数个中文得时候,就会出现乱码
而为偶数个中文时则很正常..
有没有人遇到这个情况?如何解决? 我用其他上传组件也是一样得状况