How to deal with the attachment Link under B/S in the Domino System
The attachment links of the Domino System under B/S are placed at the bottom of the page, which affects the layout and layout of the whole page.
Solution:
In B/S, the general method for handling attachments is to add the field $ v2attachmentoptions to the form and set the value to 0 to hide the default attachment link of the system, then write the link as follows:
1. Connections in read-only mode
Code:
Thisdb: = @ replacesubstring (@ subset (@ dbname;-1); ""; "+ ");"\\";"/");
@ If (@ attachments! = 0; "[<a href = \"/"+ thisdb +"/0/"+ @ text (@ documentuniqueid) + "/$ FILE/" + @ attachmentnames + "\" target = \ "_ blank \"> "+ @ attachmentnames +" </a>] ";")
2. The Selection box contains links for users to delete
Code:
Thisdb: = @ replacesubstring (@ subset (@ dbname;-1); ""; "+ ");"\\";"/");
@ If (@ attachments! = 0; "[<input type = checkbox name = \" % detach.1 \ "value = \" "+ @ attachmentnames +" \ "> <a href = \"/"+ thisdb + "/0/" + @ text (@ documentuniqueid) + "/$ FILE/" + @ attachmentnames + "\" target = \ "_ blank \"> "+ @ attachmentnames +" </a>] ";")
However, when the attachment name contains special symbols such as "#" and "&", the link written above will be truncated in the special symbol, resulting in the attachment cannot be opened normally. To solve this problem, you need to convert these special symbols when writing the link. The specific method is as follows:
Code:
Thisdb: = @ replacesubstring (@ subset (@ dbname;-1); ""; "+ ");"\\";"/");
AA: = @ urlencode ("Domino"; @ attachmentnames );
@ If (@ attachments! = 0; "[<a href = \"/"+ thisdb +"/0/"+ @ text (@ documentuniqueid) + "/$ FILE/" + AA + "\" target = \ "_ blank \"> "+ @ attachmentnames +" </a>] ";")