Asp下实现多表单域无组件文件上传的案例
发布时间:2023-09-23 15:02:58 所属栏目:Asp教程 来源:
导读:最近经常有人问到这类问题,在此转贴一下,内容:
1。数据库表结构(Access):
UserID:Text(保存上传文件的用户ID)
FileContentType:Text(用来保存上传文件的类型,eg:"Application/msword",主要用来使用户
1。数据库表结构(Access):
UserID:Text(保存上传文件的用户ID)
FileContentType:Text(用来保存上传文件的类型,eg:"Application/msword",主要用来使用户
最近经常有人问到这类问题,在此转贴一下,内容: 1。数据库表结构(Access): UserID:Text(保存上传文件的用户ID) FileContentType:Text(用来保存上传文件的类型,eg:"Application/msword",主要用来使用户能正确下载此文件) FileContent:OLE Object(保存文件数据) 2。HTML文件 muploadfile.htm <Form name="upload_file" enctype="multipart/form-data" action="muploadfile.asp" method=post> <input type=hidden name="UserID" value="abc"> <input type=hidden name="FileUploadStart"> '这里用来表示开始文件数据上传 File to send: <INPUT TYPE="file" name="file_up" size="30"><br> <INPUT TYPE="file" name="file_up" size="30"><br> <input type=hidden name="FileUploadEnd"> '这里用来表示文件数据结束 <input type=submit value=Submit> </Form></P><P> 3。ASP文件 muploadfile.asp</P><P><% Response.Expires=0 Function bin2str(binstr) Dim varlen,clow,ccc,skipflag </P><P> skipflag=0 ccc = "" If Not IsNull(binstr) Then varlen=LenB(binstr) For i=1 To varlen If skipflag=0 Then clow = MidB(binstr,i,1) If AscB(clow) > 127 Then ccc =ccc & Chr(AscW(MidB(binstr,i+1,1) & clow)) skipflag=1 Else ccc = ccc & Chr(AscB(clow)) End If Else skipflag=0 End If (编辑:聊城站长网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
推荐文章
站长推荐