Attachment download from view

寵の児 提交于 2019-12-11 14:55:23

问题


Is there a way to list all documents in a view control (or a repeat control) and have a download button / link that will allow the user to download multiple attachments that reside in a rich text field?

I have found options using the @AttachmentName, however this lists all attachments on the document and does not restrict the attachments to just one the RTF.

I have a work around using a dialog box, which does work well, just not as clean as the option I was looking for.


回答1:


In a view you can have a computed column. Any code you place into a dialog could be placed into a computed column. The getDocument() method of the XSPviewEntry gives you access to the document (recycle wisely).

update

To use a download control, use a repeat with the view as datasource and a panel per row. The panel has the data source pointing to a document. Use tr as tag for the panel.

This is only needed if you have attachments in other fields you don't want to show



来源:https://stackoverflow.com/questions/27495491/attachment-download-from-view

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!