Could anyone indicate to my why the following code displays the attachments
with the same/similar filenames twofold (double) in the browser?
Any help will be much appreciated.
Nayiri
The Code:
attNames:= @LowerCase(@AttachmentNames);
allowed:= “doc”:“pdf”:“ppt”:“xls”:“rar”:“zip”;
tmpList:= @Trim(@LeftBack(@ReplaceSubstring(attNames; “.” + allowed;
“Dummy”); “Dummy”))
*+ (“.” + allowed);
RemoveList:= @Trim(@Replace(tmpList; attNames; “”));
@Trim(@Replace(tmpList; RemoveList; “”));
@Implode(“{<a href="” + @Text(@DocumentUniqueID) + “/$file/” +
@Trim(@Replace(tmpList; RemoveList; “”)) + “" target="_blank"
class="links">” + “” + @If(@Contains(@Right(@Trim(@Replace(tmpList;
RemoveList; “”)); 3); “doc”: “pdf”: “xls”: “ppt”: “rar”: “zip”);
@Replace(@Right(@Trim(@Replace(tmpList; RemoveList; “”)); 3); “doc”: “pdf”:
“xls”: “ppt”: “rar”: “zip”;
“<img border=0 hspace="4" width="18" height="18" src=…/word.gif
Alt="Click here to open the Word file" title="Click here to open the Word
file">”:
“<img border=0 hspace="4" width="18" height="18" src=…/pdf.gif
Alt="Click here to open the PDF file" title="Click here to open the PDF
file">”:
“<img border=0 hspace="4" width="18" height="18" src=…/excel.gif
Alt="Click here to open the Excel worksheet" title="Click here to open the
Excel worksheet">”:
“<img border=0 hspace="4" width="18" height="18" src=…/ppt.gif
Alt="Click here to open the Power Point presentation" title="Click here to
open the Power Point presentation">”:
“<img border=0 hspace="4" width="18" height="18" src=…/rar.gif
Alt="Click here to download the Rar file" title="Click here to download the
Rar file">”:
“<img border=0 hspace="4" width="18" height="18" src=…/winzip.gif
Alt="Click here to download the Zip file" title="Click here to download the
Zip file">”); “”) + @Trim(@Replace(tmpList; RemoveList; “”));“
]”)