台灣最大程式設計社群網站
線上人數
917
 
會員總數:246134
討論主題:189713
歡迎您免費加入會員
討論區列表 >> ASP >> asp網頁編輯後原資料變成亂碼 ex: 測試 → 皜祈岫 → ??撗?
[]  
[我要回覆]
1
回應主題 加入我的關注話題 檢舉此篇討論 將提問者加入個人黑名單
asp網頁編輯後原資料變成亂碼 ex: 測試 → 皜祈岫 → ??撗?
價值 : 100 QP  點閱數:1279 回應數:8
樓主

蔡宗翰
門外漢
0 3
107 5
發送站內信

網站轉移 原本的環境應該是 win 2003 iis
目前的環境
win2008 R2 standard
sql sever 2008 iis7

原本的Asp網站 掛上iis7後網站出現亂碼
部分asp 第一行 <META HTTP-EQUIV=Content-Type CONTENT="text/html; charset=utf-8">

解決方式: 批次在asp 的第一行加上 <META HTTP-EQUIV=Content-Type CONTENT="text/html; charset=utf-8">
顯示正常!

但編輯資料後出現亂碼 ex: 測試 → 皜祈岫 → ??撗?



求解!

搜尋相關Tags的文章: [ asp ] , [ 編碼 ] , [ 亂碼 ] , [ utf ] , [ big5 ] ,
本篇文章發表於2016-03-23 11:58
1樓
回應

彩虹
檢舉此回應
你先確認一下是不是編輯後,再次更新資料庫時就已經變成亂碼了
(先查看一下資料庫)
本篇文章回覆於2016-03-23 13:52
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
2樓
回應

彩虹
檢舉此回應
再整理一下,可能有以下幾種可能
1.你說的編輯後出現亂碼,很有可能是在update進入到資料庫時,就已經變成亂碼了 (請查看資料庫該兩筆的資料)
2.在來請先查看你本身的.asp檔案的編碼是不是也有改成UTF-8格式 (可用編輯器查看以及轉格式儲存成UTF-8 格式)

本篇文章回覆於2016-03-23 14:02
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
3樓
作者回應

蔡宗翰
檢舉此回應



所以資料是以UTF存進資料庫

有辦法 以utf-8顯示 編輯後再以big5存入資料庫嗎!?

本篇文章回覆於2016-03-23 14:06
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
4樓
作者回應

蔡宗翰
檢舉此回應
本篇文章回覆於2016-03-23 14:07
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
5樓
作者回應

蔡宗翰
檢舉此回應
<META HTTP-EQUIV=Content-Type CONTENT="text/html; charset=utf-8">
<!--#include file="include/check.inc"-->
<!--#include file="Head.inc"-->
<!--#include file="Menu.inc"-->
<!--#include file="include/css/dbas.asp"-->
<TD valign="top" bgcolor="#E1FFFF" rowspan="21" align="center"><P style="margin-top: 10"><FONT size=+2><B>資料維護─最新公告</B></FONT><BR><FONT color="brown" size=+1><B><修改></B></FONT></P>

<%
MG_NO= Request("MG_NO")
SQL_N = "Select * from Message where MG_NO = '" & MG_NO & "'"
Set RS_N = conn1.execute(SQL_N)
%>

<SCRIPT src="include/function.js"></SCRIPT>
<SCRIPT language="javascript">
<!--
function checkv(){
var nstr='';
if(document.frm1.MG_SUBJECT.value=='')
nstr += '請輸入「主旨」\n';
if(document.frm1.MG_CONTENT.value=='')
nstr += '請輸入「內容」\n';
if(document.frm1.MG_BGDATE.value=='')
nstr += '請輸入「上線日期」\n';
if(document.frm1.MG_EDDATE.value=='')
nstr += '請輸入「下線日期」\n';

if(nstr!=''){
alert(nstr);
return false;
}

document.frm1.submit();
}
//-->
</SCRIPT>
<NOSCRIPT>檢查輸入資料格式</NOSCRIPT>


<Form name="frm1" action="sysmsg_modi.asp?MG_NO=<%=RS_N("MG_NO")%>" method="post" enctype="multipart/form-data">
<INPUT type="hidden" name="MG_NO" value="<%=RS_N("MG_NO")%>">
<TABLE border="0" width="65%" cellspacing="2" cellpadding="0" bordercolor="#4DC5FF">
<TR>
<TH align="right" width="20%" valign="top">主  旨:</TH>
<TD><TEXTAREA Rows="2" Name="MG_SUBJECT" cols="56" maxlength="200"><%=RS_N("MG_SUBJECT")%></TEXTAREA></TD></TR>
<TR>
<TH align="right" valign="top">內  容:</TH>
<TD><TEXTAREA Rows="12" Name="MG_CONTENT" cols="56">
<%
Dim W
W=Split(RS_N("MG_CONTENT"),"#")
ReDim V(Ubound(W))
For I=0 to Ubound(W)
V(I)=W(I)
If I=0 then
Response.write V(I)
Else
Response.write "#" & V(I)
End If
Next
%>

</TEXTAREA></TD></TR>
<TR>
<TH align="right">  </TH>
<TD><FONT color="red">內容僅有1項請採「XXXXX。」格式;若超過1項時,項目間須以#隔開,例:「一、XXXXX。#二、XXXXX。」。</FONT></TD></TR>
<TR>
<TH align="right" rowspan="3" valign="top">附  檔:</TH>
<TD><INPUT type="text" Name="MG_ATTCH1_1" size="23" value=<%=Mid(RS_N("MG_ATTCH1"),9,25)%>><INPUT type="file" Name="MG_ATTCH1" maxlength="200" size="25"></TD></TR>
<TR>
<TD><INPUT type="text" Name="MG_ATTCH2_1" size="23" value=<%=Mid(RS_N("MG_ATTCH2"),9,25)%>><INPUT type="file" Name="MG_ATTCH2" maxlength="200" size="25"></TD></TR>
<TR>
<TD><INPUT type="text" Name="MG_ATTCH3_1" size="23" value=<%=Mid(RS_N("MG_ATTCH3"),9,25)%>><INPUT type="file" Name="MG_ATTCH3" maxlength="200" size="25"></TD></TR>
<TR>
<TH align="right"> </TH>
<TD><FONT color="red">請儘量利用壓縮方式,將上傳檔案個數控制在3個以內。</FONT></TD></TR>
<TR>
<TH align="right">上線日期:</TH>
<TD><INPUT type="text" Name="MG_BGDATE" size="15" maxlength="7" value="<%=dat4(RS_N("MG_BGDATE"))%>">&nbsp;<INPUT type=button id="OpnDatB2" name="OpnDatB2" value="月曆" onclick="opdate('frm1','MG_BGDATE')"></TD></TR>
<TR>
<TH align="right">下線日期:</TH>
<TD><INPUT type="text" Name="MG_EDDATE" size="15" maxlength="7" value="<%=dat4(RS_N("MG_EDDATE"))%>">&nbsp;<INPUT type=button id="OpnDatB2" name="OpnDatB2" value="月曆" onclick="opdate('frm1','MG_EDDATE')"></TD></TR>
<TR>
<TH align="right">  </TH>
<TD><FONT color="red">上、下線日期請click月曆選擇日期或逕以YYYMMDD(例 0970101)輸入。</FONT></TD></TR>
<TR>
<TD align="center" colspan="2"><INPUT type="button" value="確定修改" onclick="checkv();">&nbsp;&nbsp;<Input type="button" value="返回列表" onclick="location.href='sysmsg_list.asp';"></TD></TR></TABLE>
</FORM></TD></TR></TABLE>
<P></P></TD></TR></TABLE>
<!--#include file="Foot.inc"-->
本篇文章回覆於2016-03-23 14:08
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
6樓
不錯的參考

彩虹
檢舉此回應
第一張圖是什麼?

通常MSSQL資料庫,我的欄位都型態都會選擇 ntext、nvarchar
所以在更新資料時,指令也要稍微改一下,要加上N,例如:"update table set name=N'你好' where id=123"

另外我剛剛有發送「站內信」給你了,暫時先在那邊討論吧
本篇文章回覆於2016-03-23 14:12
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
7樓
作者回應

蔡宗翰
檢舉此回應
上面是sysmsg_mod.asp
按下確定修改會sysmsg_modi.asp 寫入資料庫↓

如果不改utf-8 會亂碼 改utf-8 前台預覽正常 資料庫是big5
但加入一些語法 都出現500錯誤

<META HTTP-EQUIV=Content-Type CONTENT="text/html; charset=utf-8">
<!--#include file="include/conn.inc"-->
<!--#include file="include/function.inc"-->
<!--#include file="include/check.inc"-->

<%
DT=Year(Date()) & Month(Date()) & Day(Date())
MG_NO = Request("MG_NO")
SQL_N = "Select * from Message where MG_NO = '" & MG_NO & "'"
Set RS_N = conn1.execute(SQL_N)
DN=MG_NO

A=Request.TotalBytes
B=Request.BinaryRead(A)
Set Upload = Server.CreateObject("basp21")
MG_SUBJECT = trim(Upload.Form(B,"MG_SUBJECT"))
MG_CONTENT = trim(Upload.Form(B,"MG_CONTENT"))
MG_ATTCH1 = Upload.FormFileName(B,"MG_ATTCH1")
MG_ATTCH2 = Upload.FormFileName(B,"MG_ATTCH2")
MG_ATTCH3 = Upload.FormFileName(B,"MG_ATTCH3")
MG_ATTCH1_1 = trim(Upload.Form(B,"MG_ATTCH1_1"))
MG_ATTCH2_1 = trim(Upload.Form(B,"MG_ATTCH2_1"))
MG_ATTCH3_1 = trim(Upload.Form(B,"MG_ATTCH3_1"))
MG_BGDATE = cdat2(trim(Upload.Form(B,"MG_BGDATE")))
MG_EDDATE = cdat2(trim(Upload.Form(B,"MG_EDDATE")))

If DN<10 then
fileName1= DT & "0" & DN & "1" & Mid(MG_ATTCH1,InstrRev(MG_ATTCH1,"\")+1)
Else
fileName1= DT & DN & "1" & Mid(MG_ATTCH1,InstrRev(MG_ATTCH1,"\")+1)
End If
If DN<10 then
fileName2= DT & "0" & DN & "2" & Mid(MG_ATTCH2,InstrRev(MG_ATTCH2,"\")+1)
Else
fileName2= DT & DN & "2" & Mid(MG_ATTCH2,InstrRev(MG_ATTCH2,"\")+1)
End If
If DN<10 then
fileName3= DT & "0" & DN & "3" & Mid(MG_ATTCH3,InstrRev(MG_ATTCH3,"\")+1)
Else
fileName3= DT & DN & "3" & Mid(MG_ATTCH3,InstrRev(MG_ATTCH3,"\")+1)
End If

uploadPath1 = server.mappath(".") & "\message\" & fileName1
uploadPath2 = server.mappath(".") & "\message\" & fileName2
uploadPath3 = server.mappath(".") & "\message\" & fileName3

filePath1 = server.mappath(".") & "\" & RS_N("MG_ATTCH1")
filePath2 = server.mappath(".") & "\" & RS_N("MG_ATTCH2")
filePath3 = server.mappath(".") & "\" & RS_N("MG_ATTCH3")


If MG_ATTCH1="" then
If MG_ATTCH2= "" then
If MG_ATTCH3="" then
fileName1=Mid(RS_N("MG_ATTCH1") ,9,50)
fileName2=Mid(RS_N("MG_ATTCH2") ,9,50)
fileName3=Mid(RS_N("MG_ATTCH3") ,9,50)
If MG_ATTCH1_1="" then
filename1=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
set fs = Nothing
End If
If MG_ATTCH2_1="" then
filename2=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
set fs = Nothing
End If
If MG_ATTCH3_1="" then
filename3=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
End If
SQL_1 = " Update Message Set MG_ATTCH1='" & "message\" & filename1 & "', MG_ATTCH2='" & "message\" & filename2 & "',MG_ATTCH3='" & "message\" & filename3 & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
Else
fileName1=Mid(RS_N("MG_ATTCH1") ,9,50)
fileName2=Mid(RS_N("MG_ATTCH2") ,9,50)
If MG_ATTCH1_1="" then
filename1=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
set fs = Nothing
End If
If MG_ATTCH2_1="" then
filename2=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
set fs = Nothing
End If
SQL_1 = " Update Message Set MG_ATTCH1='" & "message\" & filename1 & "', MG_ATTCH2='" & "message\" & filename2 & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)

Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
RC3=Upload.FormSaveAs(B,"MG_ATTCH3",uploadPath3)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH3='" & "message\" & fileName3 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
End If
Else
If MG_ATTCH3="" then
fileName1=Mid(RS_N("MG_ATTCH1") ,9,50)
fileName3=Mid(RS_N("MG_ATTCH3") ,9,50)
If MG_ATTCH1_1="" then
filename1=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
set fs = Nothing
End If
If MG_ATTCH3_1="" then
filename3=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
End If
SQL_1 = " Update Message Set MG_ATTCH1='" & "message\" & filename1 & "',MG_ATTCH3='" & "message\" & filename3 & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath2)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName2%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
RC2=Upload.FormSaveAs(B,"MG_ATTCH2",uploadPath2)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH2='" & "message\" & fileName2 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
Else
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath2)>= 0 then
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName2%>、<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
%>
<script language="javascript">
<!--
alert('<%=fileName2%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
End If
Else
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
If MG_ATTCH1_1="" then
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
set fs = Nothing
SQL_1 = " Update Message Set MG_ATTCH1='" & "message\" & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)
End If
RC2=Upload.FormSaveAs(B,"MG_ATTCH2",uploadPath2)
RC3=Upload.FormSaveAs(B,"MG_ATTCH3",uploadPath3)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH2='" & "message\" & fileName2 & "', MG_ATTCH3='" & "message\" & fileName3 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
End If
End If
End If
Else
If MG_ATTCH2= "" then
If MG_ATTCH3="" then
fileName2=Mid(RS_N("MG_ATTCH2") ,9,50)
fileName3=Mid(RS_N("MG_ATTCH3") ,9,50)
If MG_ATTCH2_1="" then
filename2=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
set fs = Nothing
End If
If MG_ATTCH3_1="" then
filename3=""
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
End If
SQL_1 = " Update Message Set MG_ATTCH2='" & "message\" & filename2 & "',MG_ATTCH3='" & "message\" & filename3 & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath1)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName1%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
RC1=Upload.FormSaveAs(B,"MG_ATTCH1",uploadPath1)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH1='" & "message\" & fileName1 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
Else
If MG_ATTCH2_1="" then
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
set fs = Nothing
SQL_1 = " Update Message Set MG_ATTCH2='" & "message\" & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)
End If
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath1)>= 0 then
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName1%>、<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
%>
<script language="javascript">
<!--
alert('<%=fileName1%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
End If
Else
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
RC1=Upload.FormSaveAs(B,"MG_ATTCH1",uploadPath1)
RC3=Upload.FormSaveAs(B,"MG_ATTCH3",uploadPath3)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH1='" & "message\" & fileName1 & "', MG_ATTCH3='" & "message\" & fileName3 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
End If
End If
Else
If MG_ATTCH3="" then
If MG_ATTCH3_1="" then
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
SQL_1 = " Update Message Set MG_ATTCH3='" & "message\" & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL_1)
End If
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath1)>= 0 then
If Upload.FileCheck(uploadPath2)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName1%>、<%=fileName2%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
%>
<script language="javascript">
<!--
alert('<%=fileName1%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
End If
Else
If Upload.FileCheck(uploadPath2)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName2%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
RC1=Upload.FormSaveAs(B,"MG_ATTCH1",uploadPath1)
RC2=Upload.FormSaveAs(B,"MG_ATTCH2",uploadPath2)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH1='" & "message\" & fileName1 & "', MG_ATTCH2='" & "message\" & fileName2 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
End If
Else
Set fs=CreateObject("Scripting.FileSystemObject")
If fs.fileExists (filePath1) then
fs.deletefile filePath1, true
End If
If fs.fileExists (filePath2) then
fs.deletefile filePath2, true
End If
If fs.fileExists (filePath3) then
fs.deletefile filePath3, true
End If
set fs = Nothing
If Upload.FileCheck(uploadPath1)>= 0 then
If Upload.FileCheck(uploadPath2)>= 0 then
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName1%>、<%=fileName2%>及<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
%>
<script language="javascript">
<!--
alert('<%=fileName1%>及<%=fileName2%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
End If
Else
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName1%>及<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
%>
<script language="javascript">
<!--
alert('<%=fileName1%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
End If
End If
Else
If Upload.FileCheck(uploadPath2)>= 0 then
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName2%>及<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
%>
<script language="javascript">
<!--
alert('<%=fileName2%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
End If
Else
If Upload.FileCheck(uploadPath3)>= 0 then
%>
<script language="javascript">
<!--
alert('<%=fileName3%>檔名重覆,請查明後重新上傳!!');
history.go(-1);
//-->
</script>
<%
Else
RC1=Upload.FormSaveAs(B,"MG_ATTCH1",uploadPath1)
RC2=Upload.FormSaveAs(B,"MG_ATTCH2",uploadPath2)
RC3=Upload.FormSaveAs(B,"MG_ATTCH3",uploadPath3)
SQL = " Update Message Set MG_SUBJECT='" & MG_SUBJECT & "', MG_CONTENT='" & MG_CONTENT & "', MG_ATTCH1='" & "message\" & fileName1 & "', MG_ATTCH2='" & "message\" & fileName2 & "', MG_ATTCH3='" & "message\" & fileName3 & "', MG_BGDATE='" & MG_BGDATE & "', MG_EDDATE='" & MG_EDDATE & "', UUSER='" & session("USER_NO") & "', UDATE='" & Now & "' where MG_NO=" & MG_NO
Call conn1.execute(SQL)
%>
<script language="javascript">
<!--
alert('修改成功!!');
location.href='sysmsg_list.asp';
//-->
</script>
<%
End If
End If
End If
End If
End If
End If
set Upload = Nothing
%>



本篇文章回覆於2016-03-23 14:12
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
8樓
最有價值解答

彩虹
檢舉此回應
如果還行不通的話,可能就是上傳元件的問題 -> Server.CreateObject("basp21")
basp21編碼昰Big5
1.除非更換一下上傳元件
2.或者將網站全部改回big5
本篇文章回覆於2016-03-23 18:36
== 簽名檔 ==
--未登入的會員無法查看對方簽名檔--
   
1

回覆
如要回應,請先登入.