logo

New Response

« Return to the main article

You are replying to:

  1. Probably out of date now, but I have several gif files in the database, each of which has the name of a file extension.

    e.g.

    an icon representing .gif files is named 'gif' an icon representing .jpg files is named '.jpg' and aliased '.jpe'

    Then I use the following in as part of a formula.

    "<tr><td width=\"10\"><img onerror=\"this.src=\'../***\'\" src=\"../"+@Right(@Text(@AttachmentNames);".")+"\"></td><td width=\"10\"><input type=\"checkbox\" name=\"%%Detach\" value=\""+@AttachmentNames+"\" class=\"line1\"></td><td><a href=\"" + @Text(@DocumentUniqueID) + "/$file/" + @AttachmentNames+ "\">"+@AttachmentNames + "</a></td><td>" + @Text(@Round(@AttachmentLengths/1024)) + " (Kbytes)</td></tr>"

    Note : onerror=\"this.src=\'../***\'\" this javascript makes a default icon appear '***' from the image resources, if no other icon is found.

    Hope this helps if you still needed a way of displaying an icon if none found.

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: