多个附件字段或附件标识符 [英] Multiple Attachment Fields or attachment identifier

查看:1277
本文介绍了多个附件字段或附件标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一项任务,我需要在表单中具有多个附件字段才能提交数据.我可以在一个附件字段中附加多个文件.我知道在SharePoint自定义列表中以及何时没有多个附件字段是不可能的 我将附件复制到表单的多个部分,使其仅显示重复的附件.

I have a task that I need to have multiple attachment fields in a form to submit data. I am able to attach multiple files at with the one attachment field. I know that Its not possible to have multiple attachment fields in SharePoint custom list and when I copy the attachment to multiple sections of the form it only show duplicated attachments .

我只是想知道是否可以使用一种脚本来分别标识附件中不同部分中的上载数据?如果没有,您能推荐我至少确定不同部分附加的内容吗? 的形式?

I was just wondering is there a way where I could have a script to separately identify the uploaded data in attachment field in different sections? If not, could you recommend me what I could do to at least identify what has been attached in different section of a form?

在此先感谢

推荐答案

SharePoint列表中可能有多个附件字段.您需要创建自定义列表表单(新建,编辑,显示),并使用SharePoint Designer添加文件上传控件来实现它.

It is possible to have multiple attachment fields in SharePoint List. You need to create custom List forms (new, edit, display), add file upload control using SharePoint designer to achieve it.

请务必注意,列表项的所有附件都存储在一个名为 附件". 将附件添加到列表项,然后编辑表单并将鼠标悬停在附件上,您将在状态栏中看到以下URL:

It is important to note that all attachments of a List Item is stored in a same folder called "Attachments". Add an attachment to a list item, then edit the form and hover your mouse to the attachments you will see the following URL in the status bar:

http://服务器名称/站点名称/列表/列表名称/附件/ItemID/附件名称.fileExtension

http://servername/sitename/Lists/ListName/Attachments/ItemID/AttachmentName.fileExtension 

解决方案:

1.创建一个List列Attachment1和数据类型作为单行文本.
2.在SharePoint Designer中打开列表,然后创建一个自定义新表单
3.在自定义新表格中->在您的列表字段(Attachment1)下添加代码

1. Create a List column Attachment1 and datatype as single line text.
2. Open List in SharePoint Designer and create a custom new form
3. In the custom new form -> add the code below your list field (Attachment1)

<div id="attachmentsOnAttachC2">
<input type="file" name="AttachC20" id="AttachC20" class="ms-longfileinput" size="56" title="fupldAttachDnbReport"></input>                                                                                                                                        
</div>
<input id="attachOKbutton2" type="BUTTON" onclick='CustomOkAttach(this,"AttachC2","Attachment1")' value="Upload" style="width: 12.8em;"/>                                                                                                                                                
<table id="idAttachmentsTable2" border="0" cellspacing="0" cellpadding="0"><tbody></tbody>                                         
</table>   

4.现在,将此代码添加到脚本文件或创建一个单独的JS文件并引用它.您可能需要注意附件字段的控件,ID和标题才能获得此结果.

4. Now, add this code to a script file or create a separate JS file and refer it. You may need to give attention to the control, ID and title of the attachment field to achieve this result.

<script type="text/javascript" src="../../Style Library/Scripts/jquery-3.0.0.min.js"></script>
<script type="text/javascript" src="../../Style Library/Scripts/jquery.validate.min.js"></script>

<script type="text/javascript">
function CustomOkAttach(self, idprefix, fieldtitle) {
    a: ;
    var g = idprefix + String(FileUploadIndex);
    var idobject =


(self).parent().find('input [id ^ ='+ idprefix +']').filter(function(){return
(self).parent().find('input[id^=' + idprefix + ']').filter(function () { return


(this).css('display')!='none'}); var id =
(this).css('display') != 'none' }); var id =


这篇关于多个附件字段或附件标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆