很久以前我也有类似的要求。我最终使用 CustomAction 来扩展上传 UI;并在单击该项目时弹出一个模态灯箱;该框的 UI 包括文件上传控件以及所有标准和自定义字段。诀窍是简单地使用 UrlAction 元素的“Url”属性来启动脚本。上传是通过网络服务处理的。
用户上传工作流程然后只需要一个回发(导航到 doclib 本身)
我称它为“快速上传”的效果。
这是 Elements.xml 的样子
<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
<!-- Document Library Toolbar Upload Menu Dropdown -->
<CustomAction Id="UserInterfaceCustomActions.DocLibUploadToolbar"
RegistrationType="List"
RegistrationId="101"
GroupId="UploadMenu"
Rights="ManagePermissions"
Location="Microsoft.SharePoint.StandardMenu"
Sequence="1000"
Title="Quick Upload">
<UrlAction Url="javascript:ShowUploadLightBoxWithCustomFields()"/>
</CustomAction>
</Elements>