Sub upload_0 () set upload = new UpFile_Class "creates an upload object
Upload. GetDate (int (Forum_Setting (56) * 1024) 'to obtain the uploaded data, not limited to size
ICount = 0
If upload. err> 0 then
Select case upload. err
Case 1
Response. Write "select the file you want to upload first [<a href = # onclick = history. go (-1)> re-upload </a>]"
Case 2
Response. write "the image size exceeds the limit" & Forum_Setting (56) & "K [<a href = # onclick = history. go (-1)> re-upload </a>]"
End select
Exit sub
Else
FormPath = upload. form ("filepath ")
"Add (/) after the Directory (/)
If right (formPath, 1) <> "/" then formPath = formPath &"/"
For each formName in upload. file "lists all uploaded files.
Set file = upload. file (formName) "to generate a file object
If file. filesize <100 then
Response. write "select the image you want to upload first [<a href = # onclick = history. go (-1)> re-upload </a>]"
Response. end
End if
FileExt = lcase (file. FileExt)
If CheckFileExt (fileEXT) = false then
Response. write "the file format is incorrect [<a href = # onclick = history. go (-1)> re-upload </a>]"
Response. end
End if
Randomize
RanNum = int (90000 * rnd) + 10000
Filename = formPath & year (now) & month (now) & day (now) & hour (now) & minute (now) & second (now) & ranNum &". "& fileExt
'Test whether the file character is invalid
Dim R_Char, R_ I
For R_ I = 1 to Len (filename)
R_Char = ASC (MID (filename, R_ I, 1 ))
If R_Char = 0 then
Response. write "Is it good to do something meaningful? hackers are studying technology, not damaging"
Response. end
End if
Next
If file. FileSize> 0 then "if FileSize> 0, file data exists.
File. SaveToFile Server. mappath (filename) "save the file
'Response. write file. FilePath & file. FileName & "(" & file. FileSize & ") =>" & formPath & File. FileName & "is successful! <Br>"
Response. write "<script> parent.doc ument. forms [0]. myface. value = '" & FileName & "' </script>"
ICount = iCount + 1
End if
Set file = nothing
Next
Set upload = nothing
Session ("upface") = "done"
Htmend iCount & "file upload is complete !"
End ifend sub