📄 uploadedit.asp.bak
字号:
<%@ Language=VBScript %>
<!--#include file="conn.asp"-->
<!-- #include file="upload.asp" -->
<%
'创建文件上载对象,FileUploader类在upload.asp中定义
Set Uploader = New FileUploader
'设置表单的字符集
Uploader.FormCharSet = "gb2312"
'执行上载
Uploader.Upload()
title = Uploader.Form("title")
If Uploader.Files.Count = 0 Then
Response.Write "没有上载的文件."
Else
If Uploader.Form("docid") <> "" Then
For Each File In Uploader.Files.Items
If (Ucase(File.InputName) = "EDITFILE") Then
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "files", conn, adOpenDynamic, adLockOptimistic
RS.Find "fid="& Uploader.Form("docid")
RS("title") = title
RS("fsize") = File.FileSize
RS("fcontent").AppendChunk file.filedata
RS.Update
RS.Close
set RS = Nothing
Response.Write "修改已保存: " &title & "<br>"
Response.Write "大小: " & File.FileSize & " bytes<br>"
END IF
Next
else
For Each File In Uploader.Files.Items
If (Ucase(File.InputName) = "EDITFILE") Then
Set RS = Server.CreateObject("ADODB.Recordset")
RS.Open "files", conn, adOpenDynamic, adLockOptimistic
RS.AddNew
RS("fname") = File.FileName
RS("title") = title
RS("fsize") = File.FileSize
RS("fcontent").AppendChunk file.filedata
RS.Update
RS.Close
set RS = Nothing
Response.Write "在线编辑的文件: " &title & "<br>"
Response.Write "大小: " & File.FileSize & " bytes<br>"
END IF
Next
End If
End If
Set Uploader = Nothing
Closeconn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -