28,406
社区成员
发帖
与我相关
我的任务
分享
Dim u, photo, photoName, photoSize, photoExt
Set u = New upload_5xsoft
Set rs = CreateObject("ADODB.RecordSet")
rs.Open "SELECT TOP 1 * FROM [myTable] WHERE 1=2", conn, 1, 3
rs.AddNew
rs.Fields("name").Value = u.Form("name")
rs.Fields("tel").Value = u.Form("tel")
rs.Fields("address").Value = u.Form("address")
Set photo = u.File("photo") ' 上面漏了
photoSize = photo.FileSize
photoName = photo.FileName
photoExt = photo.FileExt
If photoSize>0 And InStr("|bmp|gif|jpg|png|", "|" & LCase(photoExt) & "|") Then
Data_5xsoft.Position = photo.FileStart
rs.Fields("photo").AppendChunk Data_5xsoft.Read(photo.FileSize)
End If
rs.Update
rs.Close
Set rs = Nothing
Set u = Nothing
<!--#include file="upfile.asp" -->
<%
Dim u, photo, photoName, photoSize
Set u = New upload_5xsoft
Set rs = CreateObject("ADODB.RecordSet")
rs.Open "SELECT TOP 1 * FROM [myTable] WHERE 1=2", conn, 1, 3
rs.AddNew
rs.Fields("name").Value = u.Form("name")
rs.Fields("tel").Value = u.Form("tel")
rs.Fields("address").Value = u.Form("address")
If photo.FileSize>0 And InStr("|bmp|gif|jpg|png|", "|" & LCase(photo.FileExt) & "|") Then
Data_5xsoft.Position = photo.FileStart
rs.Fields("photo").AppendChunk Data_5xsoft.Read(photo.FileSize)
End If
rs.Update
rs.Close
Set rs = Nothing
Set u = Nothing
%>