Martin Scott Consulting | WirelessMail Overview
 

Download Attachments from a View
Source: Zvonko.Paunoski@icn.siemens.de, 01/29/1999
Implementation: None (plug and play)Server: 4.5
Code Type: Formula, HTMLRequired Client: (none)
Comments
This is useful in document libraries. It allows readers to fetch attachmants without opening container documents.
Limitations
Based on HTML tags.
Code
Create a view in wich a column has this big formula:

@If(@Attachments;"<*!-- "+@AttachmentNames+" --><*A REF=/"+ @Subset(@DbName;-1)+"/AllDocs/"+@Text(@DocumentUniqueID)+"/$FILE/"+ @AttachmentNames+">"+@AttachmentNames+" "+ @Text(@AttachmentLengths) +" Bytes <*/A>" ;"<*!-- "+ @AttachmentNames+" -->"+@AttachmentNames+"<*/h7>")

Please note:
- Replace all chars: <* with <
- You nead a view with sorted docids in the FIRST column, in example is this "AllDocs".
- HTML comments <!-- --> are only for sorting purpose in the upper formula.
- Only for optics is the attachments lengths contained in the anchor name (get it out).
- </h7> is only because I had no better idea for closing pass trough breckets ].
- If you want, you can compute all this values at the time off saving the attachments in the form.

When you precalculate the strings and save it in documents then is the view faster built containing only var names.


File Attachment Icon
attach.txt