REM "First check to see if the file can be viewed as an image in the browser ";
NoPreviewMsg := "无可用图片 - 附加文件的类型属于未知的图像类型。 ";
SupportedImages := ".gif ": ".jpeg ": ".jpg ": ".jpe ": ".jfif ": ".pjpeg ": ".pjp ";
@If(@Ends(@LowerCase(FileUpFileName); SupportedImages); " "; @Attachments = 0; @Return( " "); @Return(NoPreviewMsg));
REM "Determine the directory seperator from the platform that we are running on ";
DirSep := @If(@Contains(@Platform; "Win " : "OS/2 "); "\\ ";
@Contains(@Platform; "UNIX "); "/ ";
@Contains(@Platform; "Mac "); ": ";
" ");
REM "Construct the URL to preview the file attachment ";
DBPath := @Subset(@DbName; -1);
DBPathFixed := @ReplaceSubstring(DBPath; DirSep; "/ " );
View := "LookupPersonalProfiles ";
AbbrName := @Name([Abbreviate]; Who);
replspName := @ReplaceSubstring(AbbrName; " "; "# ");
KeyName := @ReplaceSubstring(replspName; "/ "; "_ ");
key := @Subset(@AttachmentNames; 1);
DocID := @Text(@DocumentUniqueID);
URL := "[ <img src= " + "\ "/ " + DBPathFixed + "/ " + View + "/ " + KeyName + "/$file/ " + Key + "\ "> ] ";
"[ <BR> ] "+U