ACTIVE SERVER PAGE > ÄÚµù ¹æ¹ý
µî·ÏÀÏ : 2017-07-03 20:19
Á¶È¸¼ö : 52,856
UTF-8À» Áö¿øÇÏ´Â ABCUPload 4.1 ¹öÀü ¿¹Á¦ ÀÔ´Ï´Ù.
set FSO = Server.CreateObject("Scripting.FileSystemObject")
set UploadForm = Server.CreateObject("ABCUpload4.XForm")
UploadForm.CodePage = 65001
UploadForm.Overwrite = True 'µ¤¾î¾²±â Çã¿ë
UploadForm.AbsolutePath = True
UploadForm.MaxUploadSize = 1024*1024*10 'ÆÄÀÏ¿ë·® (10M)
board_title = UploadForm("board_title")(1)
'³¯Â¥ Æú´õ »ý¼º
UP_DIR="/file_data"
UP_DIR = Server.MapPath(UP_DIR)
'ÆÄÀÏ÷ºÎ1
Set theField = UploadForm("uploadedfile")(1) 'ÆÄÀÏÀÌ ¾÷·Îµå µÇ¾ú´Ù¸é
If theField.FileExists Then
fileName = theField.safeFileName 'ÆÄÀϸí
fileSize = theField.Length 'ÆÄÀÏ»çÀÌÁî
if fileSize>(1024*1024*10) then
message = "ÈÀÏ ¿ë·®ÀÌ 20MÀ» ÃÊ°úÇÒ¼ö ¾ø½À´Ï´Ù."
Else
strname = Mid(fileName,1,InstrRev(fileName,".")-1)
strExt = Lcase(Mid(filename,InstrRev(filename,".")+1))
strname = file_StrDelete(strname) 'ÆÄÀϸí Ư¼ö¹®ÀÚ »èÁ¦
bExist = True
strfilename = strname & "." & strExt
cntFile = 0
do while bExist
if (FSO.FileExists(UP_DIR&"/"&strfilename)) then
cntfile = cntfile+1
strfilename = strname&"_"&cntfile&"."&strExt
else
bExist = false
end if
Loop
filename1 = strfilename
msg = filename1 &""
theField.Save UP_DIR &"/"& filename1 'ÆÄÀÏÀúÀå
End if
End If
IF len(trim(filename1))>1 THEN
FILENAME1=CSTR(yea)+cstr(mon)+"/"+filename1
end if