권장 : ASP를 사용하여 액세스 데이터베이스의 GIF 이미지를 표시하는 방법 쓰기 : 1 : GIF 이미지 파일을 메모리로 읽습니다 (변수 strtemp). 2 : 데이터베이스에 쓰십시오. 다음은 인용 된 내용입니다 : Dim Bintmp () As As as as as adodb.conn
| 다음은 인용 된 내용입니다. <% 응답 .buffer = true Server.scriptTimeout = 9999999 다음에 오류가 재개됩니다 %> <!-#포함 파일 = conn.asp-> <!-#include file = function.asp--> <! doctype html public- // w3c // dtd xhtml 1.0 transitional // en http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd> <html xmlns = http : //www.w3.org/1999/xhtml> <헤드> <meta http-equiv = content-type content = text/html; charset = gb2312 /> <meta http-equiv = content-language content = zh-cn /> <메타 내용 = 모든 이름 = 로봇 /> <스타일 유형 = 텍스트/CSS> <!- 신체, 입력 {font-size : 12px;} -> </스타일> <title> ASP 파일 업로드 </title> </head> <Body ID = Body> <% 체크 무저 () extName = xls 'allow extension SavePath = 업로드 'SavePath 오른쪽 인 경우 (SavePath, 1) <>/ 그런 다음 SavePath = SavePath &/ 'Add (/) 후에 CheckandCreateFolder (SavePath) uploadall_a = request.totalBytes '클라이언트의 모든 내용을 가져옵니다. if (uploadall_a> 0) 그러면 UPLOADSTREAM_C = server.createObject (adodb.stream) 설정 uploadstream_c.type = 1 uploadstream_c.open uploadstream_c.write request.binaryread (uploadall_a) uploadstream_c.position = 0 formdataall_d = uploadstream_c.read crlf_e = chrb (13) & chrb (10) formstart_f = instrb (formdataall_d, crlf_e) formend_g = instrb (formstart_f 1, formdataall_d, crlf_e) set formstream_h = server.createobject (adodb.stream) formstream_h.type = 1 formstream_h.open uploadstream_c.position = formstart_f 1 uploadstream_c.copyto formstream_h, formend_g-formstart_f-3 formstream_h.position = 0 formstream_h.type = 2 formstream_h.charset = gb2312 formstreamtext_i = formstream_h.readtext formstream_h.close filename_j = mid (formstreamtext_i, instrev (formstreamtext_i,) 1, formend_g) if (checkfileext (filename_j, extname)) savefile = server.mappath (savepath & filename_j) 그렇다면 응답. 파일 업로드 : <span style = color : red;> 파일 업로드 오류! </span> <a href = & request.servervariables (url) &> 파일을 다시 업로드합니다 </a> <br/> err.clear 또 다른 SaveFile = CheckFileExists (SaveFile) SaveFileName = MID (SaveFile, Instrev (SaveFile,) 1) 세션 (파일) = SaveFileName입니다 k = instrb (formdataall_d, crlf_e & crlf_e) 4 l = instrb (k 1, formdataall_d, leftb (formdataall_d, formstart_f-1)) -k-2 formstream_h.type = 1 formstream_h.open uploadstream_c.position = k-1 uploadstream_c.copyto formstream_h, l formstream_h.savetofile savefile, 2 SaveFileName = MID (SaveFile, Instrev (SaveFile,) 1) Dim Conn1, Driver1, DBPath1, RS1, SQL1 '연결 객체를 만듭니다 set conn1 = server.createobject (adodb.connection) driver1 = driver = {Microsoft Excel Driver (*.xls)}; dbpath1 = dbq = & server.mappath (업로드/& savefilename) '오픈 메소드를 호출하여 데이터베이스를 엽니 다 CONN1. OPEN DRIVER1 & DBPATH1 sql1 = select * from [sheet1 $] RS1 = Conn1.Execute (SQL1) 세트 rs1.eof 및 rs1.bof 인 경우 응답. 필요한 데이터는 찾을 수 없습니다 !! 또 다른 Rs1.eof가 아닌 상태에서하십시오 '데이터베이스에 삽입하십시오 OpenDatabase Select *에서 ABC LEN (rs1 (0)) = 7 인 경우 ctime = 왼쪽 (RS1 (0), 4) 또 다른 ctime = 왼쪽 (RS1 (0), 5) 끝 If rs.addnew rs (시간) = C 시간 Rs.update ClosedAtabase () rs1.movenext 고리 끝 If rs1.close RS1 = 아무것도 설정하지 않습니다 conn1.close Conn1 = 아무것도 설정하지 않습니다 '데이터베이스에서 끝납니다 응답. 파일 업로드 : <span style = color : red;> & savefilename & </span> 파일 업로드가 성공했습니다! <a href = 'choise.asp' '> 파일을 계속 업로드하십시오 </a> <br /> 끝 If 또 다른 응답. 파일 업로드 : <span style = color : red;> 파일 형식이 잘못되었습니다! </span> <a href = & request.servervariables (url) &> 파일 재 포장 </a> <br/> 끝 If 또 다른 %> <스크립트 언어 = javaScript> <!- function validInput () { if (document.upform.upfile.value ==) { 경고 (파일 업로드를 선택하십시오!) document.upform.upfile.focus () 거짓을 반환하십시오 } 진실을 반환하십시오 } //-> </스크립트> <form action = '< %= request.servervariables (url) %>'method = 'post'name = upform onsubmit = return validinput () enctype = multiptart/form-data> 파일 업로드 : <입력 유형 = '파일'이름 = 'upfile'size = 40> <입력 유형 = '제출'value = upload> </form> <% 끝 If formstream_h = 아무것도 설정하지 않습니다 uploadstream.close UPLOADSTREAM = 아무것도 설정하지 않습니다 %> </body> </html> |
공유 : ASP anti-SQL 주입 코드를 해석하십시오 다음은 참조 된 내용입니다. Dim SQL_INJDATA, SQL_INJ, SQL_GET, SQL_DATA, SQL_POST SQL_INJDATA = '및 | exec | 삽입 | 선택 | 삭제 | 업데이트 |