zoukankan      html  css  js  c++  java
  • Domino中B/S下的附件链接

    一、只读链接
    thisDb:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName;-1);" ";"+");"\\";"/");
    @If(@Attachments!=0;"[<a href=\"/"+thisDb+"/0/"+@Text(@DocumentUniqueID)+"/$FILE/"+@AttachmentNames+"\" target=\"_blank\">"+@AttachmentNames+"</a>]";"")

    二、可删除链接
    thisDb:=@ReplaceSubstring(@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>]";"")


    但是,当附件的名称中包含“#”、“&”等特殊符号时(例如jeep#beijing.jpg),上面写的链接在特殊符号处就会被截断,从而导致附件不能正常打开。要解决这个问题,需要在写链接的时候把这些特殊符号进行转换,具体方法如下:
    thisDb:=@ReplaceSubstring(@ReplaceSubstring(@Subset(@DbName;-1);" ";"+");"\\";"/");
    aa:=@URLEncode("domino";@AttachmentNames);
    @If(@Attachments!=0;"[<a href=\"/"+thisDb+"/0/"+@Text(@DocumentUniqueID)+"/$FILE/"+aa+"\" target=\"_blank\">"+@AttachmentNames+"</a>]";"")
  • 相关阅读:
    BZOJ4327 : JSOI2012 玄武密码
    BZOJ4303 : 数列
    BZOJ1077 : [SCOI2008]天平
    BZOJ1829 : [Usaco2010 Mar]starc星际争霸
    BZOJ1770 : [Usaco2009 Nov]lights 燈
    BZOJ3012 : [Usaco2012 Dec]First!
    BZOJ4320 : ShangHai2006 Homework
    BZOJ4311 : 向量
    BZOJ3075 : [Usaco2013]Necklace
    BZOJ4304 : 道路改建
  • 原文地址:https://www.cnblogs.com/hannover/p/2328934.html
Copyright © 2011-2022 走看看