Developer on Alibaba Coud: Build your first app with APIs, SDKs, and tutorials on the Alibaba Cloud. Read more ＞
<% '': Convert the current date and time to the serial number.
Function makefilename (fname)
Fname = now ()
Fname = replace (fname ,"-","")
Fname = replace (fname ,"","")
Fname = replace (fname ,":","")
Fname = replace (fname, "PM ","")
Fname = replace (fname, "AM ","")
Fname = replace (fname, "morning ","")
Fname = replace (fname, "afternoon ","")
Makefilename = fname
You can use this statement vfname = makefilename (now () to call the current time,
If response. write vfname is set, it is displayed as "year", "month", and "day.
If the type of the uploaded file is obtained during virtual Upload, you can use the following function:
Function GetExtendName (FileName)
ExtName = LCase (FileName)
ExtName = right (ExtName, 3)
ExtName = right (ExtName, 3-Instr (ExtName ,"."))
GetExtendName = ExtName
You can use this method to compare the types of uploaded files by using the instr function.
If Instr (".gif.jpg.png", GetExtendName (file. FileName) then' limits the Upload file type
The 'typeflag = 1' file is of the allowed type.
Vfname = makefilename (now () 'file is allowed type to execute this line
Fname = vfname & "." & GetExtendName (file. FileName)
File. SaveAs Server. mappath (UpFilePath & fname) ''save the file
'Typeflag = 0' file type is not allowed
Response. write ("alert ('does not support the file type you uploaded! ');")
Response. write ("history. back ();")
Response. write ("</script> ")
This article is an English version of an article which is originally in the Chinese language on aliyun.com and is provided for information purposes only. This website makes no representation or warranty of any kind, either expressed or implied, as to the accuracy, completeness ownership or
reliability of the article or any translations thereof. If you have any concerns or complaints relating to the article, please send an email, providing a detailed description of the concern or
complaint, to email@example.com. A staff member will contact you within 5 working days. Once verified, infringing content will be removed immediately.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
and provide relevant evidence. A staff member will contact you within 5 working days.