asp¼òµ¥ÎļþÉÏ´«Ô´Âë
Îļþ1.ÉÏ´«½çÃæÎļþ upload.htm
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ÎļþÉÏ´«</title>
</head>
<body>
<form method="POST" action="SaveFile.asp">
ÎļþÉÏ´«£º<input type="file" name="file" size="42"> <input type="submit" value="Ìá½»" name="bb">
</form>
</body>
</html>
Îļþ2.±£´æÉÏ´«Îļþ SaveFile.asp
<%
dim file,filename,houzui
file = Request.Form("file")
if file="" then
response.write"<script>alert('ÇëÑ¡ÔñÒªÉÏ´«µÄÎļþ£¡');window.location.href='upload.htm';</script>"
else
houzui=mid(file,InStrRev(file, "."))
if houzui=".gif" or houzui=".jpg" or houzui=".bmp" then 'ÔÊÐíÉÏ´«µÄÎļþÀàÐÍ
filename=year(date) & month(date) & day(date) & Hour(time) & minute(time) & second(time) & houzui
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = 1
objStream.Open
objStream.LoadfromFile file
objStream.SaveToFile Server.MapPath(filename),2
objStream.Close
//============================°ÑÎļþÃûдÈëÊý¾Ý¿â£¬ÈçÎÞÐèÒª£¬¿Éɾ³ý´Ë¶Î´úÂ룡
Set conn = Server.CreateObject("ADODB.Connection")
conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("mb.mdb")
set rs=server.CreateObject("adodb.recordset")
rs.open "select*from img",conn,1,2
rs.addnew
rs("name")=filename
rs.update
set rs=nothing
&
Ïà¹ØÎĵµ£º
Õ⼸ÌìºÃ¶àÈËÎÊÎÒÈçºÎÔÚasp³ÌÐòÖпØÖÆÉãÏñÍ·È¥×¥ÅÄÕÕƬ£¬asp¼¼Êõ»¹ÊÇ99ÄêµÄʱºò¿´¹ýÒ»µãµã£¬Ôç¾Í×ÅÃ×·¹³ÔÁË£¬²»¹ý¼ÈÈ»ÓÐÈËÎÊ£¬ÄǾÍÊÇ¿´µÃÆðÔÛ£¬»¨ÁËÒ»¸öÍíÉϵÄʱ¼ä°Ñasp³ÌÐòµ÷ÓÃÉãÏñÍ·ÅÄÕÕµÄÎÊÌâ¸ã¶¨ÁË£¬ÏּǼÈçÏ£¬ÈÃÓÐÀàËÆÐèÇóµÄͬѧ¿ÉÒÔÉÙ×ßЩÍä·¡£
Óõ½µÄ¼¼Êõ£º
1.asp³ÌÐòÖÐ×÷base64±àÂëºÍ½âÂ룬ʹÓõÄÊÇmsxml×é¼þ£ ......
1.Èç¹ûÄúµÄ²Ù×÷ϵͳΪWindows 98£¬ÇëÔËÐÐ Windows98µÄ°²×°¹âÅÌ¡£ÔÚÆäAdd-ons\pwsĿ¼ÏÂÕÒµ½pwsµÄ°²×°³ÌÐò£¬ÔËÐа²×°¼´¿É
2.Èç¹û²Ù×÷ϵͳΪ Windows 2000 ÒÔÉÏ£¬¿ÉÒÔ°´Í¼4.1.1µÄ·½·¨°²×° IIS£º
´ò¿ª¡¾¿ØÖÆÃæ°å¡¿£¬ÕÒµ½ ¡¾Ìí¼Ó/ɾ³ý³ÌÐò¡¿→¡¾Ìí¼Ó/ɾ³ýWINDOWS×é¼þ¡¿£¬
µ¯³ö ¡¾Windows ×é¼þÏòµ¼¡¿ £¬Ñ¡Ôñ ¡¾Internet ......
¡¡IISĬÈϵĴíÎóÒ³ÊǺܲ»ÓѺõģ¬ºÜ¶àÈË¿´µ½Ä¬ÈϵĴíÎóҳʱ¶¼»á˵£ºÍøÕ¾´ò²»¿ªÁË£¡°×°×ËðʧÁËÕⲿ·ÖÁ÷Á¿¡£¶øÈç¹û´íÎóÒ³Ö±½ÓÌøתµ½Ê×Ò³ÓÖ¶ÔËÑË÷ÒýÇæºÜ²»ÓѺ㬸㲻ºÃÊ×Ò³»¹»á±»·âµô¡£ËùÒÔ¸ù¾ÝÇé¿ö£¬ÓÐÁ½¸ö·½·¨½â¾öÕâ¸öÎÊÌ⣺
¡¡¡¡Èç¹ûÊDz©¿ÍµÈÄÚÈÝÐ͵ÄÍøÕ¾£¬¿ÉÒÔ·µ»ØÒ»¸ö´øÓÐ404´íÎóµÄËÑË÷¿òÈ÷ÿÍËÑË÷£¬ÈôÊǵç×ÓÉÌÎñÐÍÍøÕ¾ ......
Adodb.StreamÊÇADOµÄStream¶ÔÏó,Ìṩ´æÈ¡¶þ½øÖÆÊý¾Ý»òÕßÎı¾Á÷,´Ó¶øʵÏÖ¶ÔÁ÷µÄ¶Á¡¢Ð´ºÍ¹ÜÀíµÈ²Ù×÷.
ÓÐÏÂÁз½·¨£º
Cancel ·½·¨
ʹÓ÷½·¨ÈçÏÂ
Object.Cancel
˵Ã÷£ºÈ¡ÏûÖ´ÐйÒÆðµÄÒì²½ Execute »ò Open ·½·¨µÄµ÷Óá£
Close ·½·¨
......
'SQL·À×¢È뺯Êý£¬µ÷Ó÷½·¨£¬ÔÚÐèÒª·À×¢ÈëµÄµØ·½Ìæ»»ÒÔÇ°µÄrequest("XXXX")ΪSafeRequest("XXXX")
'www.yongfa365.com
Function
SafeRequest(ParaValue)
ParaValue =
Trim
(
Request
(Pa ......