Author: a man like a dog
Upfile_flash.asp
######################################## ######################################## ########################
<%
Set upload = new upload_file
If upload. form ("act") = "uploadfile" then
Filepath = trim (upload. form ("filepath "))
Filelx = trim (upload. form ("filelx "))
I = 0
For each formName in upload. File
Set file = upload. File (formName)
The file extension obtained by fileExt = lcase (file. FileExt) 'does not include.
If file. filesize <100 then
Response. write "select the file you want to upload first! [Re-upload]"
Response. end
End if
If (filelx <> "swf") and (filelx <> "jpg") then
Response. write "this file type cannot be uploaded! [Re-upload]"
Response. end
End if
If filelx = "swf" then
If fileext <> "swf" then
Response. write "Only Flash files in swf format can be uploaded! [Re-upload]"
Response. end
End if
End if
If filelx = "jpg" then
If fileext <> "gif" and fileext <> "jpg" and fileext <> "swf" then
Response. write "only jpg/gif/swf images can be uploaded! [Re-upload]"
Response. end
End if
End if
If filelx = "swf" then
If file. filesize> (3000*1024) then
Response. write "a maximum of 3 MB of Flash files can be uploaded! [Re-upload]"
Response. end
End if
End if
If filelx = "jpg" then
If file. filesize> (1000*1024) then
Response. write "up to www.2cto.com can only upload 1000 K image files! [Re-upload]"
Response. end
End if
End if
Randomize
RanNum = int (90000 * rnd) + 10000
Filename = filepath & year (now) & month (now) & day (now) & hour (now) & minute (now) & second (now) & ranNum &". "& fileExt
%>
<%
If file. FileSize> 0 then "if FileSize> 0, file data exists.
'File. SaveAs Server. mappath (filename) "save the file
File. SaveToFile Server. mappath (FileName)
'Response. write file. FileName & 'is uploaded successfully!
"
'Response. write "new file name:" & FileName &"
"
'Response. write "the new file name has been copied to the desired location. Close the window !"
If filelx = "swf" then
Response. write ""
End if
Response. write ""
%>
<%
End if
Set file = nothing
Next
Set upload = nothing
End if
%>
######################################## ######################################## ########################
Upload directly with kiddie
Www.2cto.com:
The above analysis is detailed. Fix it by yourself.