1. Read-Only links
Thisdb: = @ replacesubstring (@ subset (@ dbname;-1); ""; "+ ");"\\";"/");
@ If (@ attachments! = 0; "[<a href = \"/"+ thisdb +"/0/"+ @ text (@ documentuniqueid) + "/$ FILE/" + @ attachmentnames + "\" target = \ "_ blank \"> "+ @ attachmentnames +" </a>] ";")
2. Deletion links
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 name of the attachment contains special symbols (for example, jeepw.beijing.jpg), 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:
thisdb: = @ replacesubstring (@ subset (@ dbname; -1); ""; "+"); "\"; "/");
AA: = @ urlencode ("Domino"; @ attachmentnames );
@ if (@ attachments! = 0; "[ "+ @ attachmentnames +" ] ";")