⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test.asp

📁 用摄像头在线拍照片,上传到服务器,也可以自己画一个图片上传到服务器
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
session.CodePage=65001
Response.Buffer = True  
Response.ExpiresAbsolute = Now() - 1  
Response.Expires = 0  
Response.CacheControl = "no-cache"  
Response.AddHeader "Pragma", "No-Cache" 
Response.Charset="UTF-8"

Server.ScriptTimeout = 900

Function FormatName(FileExt)
	Dim RanNum
	Randomize
	RanNum = Int(90000*rnd)+10000
	FormatName = Year(now)&Month(now)&Day(now)&Hour(now)&Minute(now)&Second(now)&RanNum&FileExt
End Function


dim TotalBytes,Ads,filename
TotalBytes = Request.TotalBytes	
filename=FormatName(".jpg")

Set Ads = Server.CreateObject("Adodb." & "Stream")
With Ads
	.Type = 1
	.Open
	.Write request.BinaryRead(TotalBytes)
	.SaveToFile Server.MapPath("photo/"&filename), 2
	.Cancel()
	.Close()
End With
Set Ads=nothing

Response.write("success=OK&filename="&filename)
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -