Welcome to Squishdot How-To Newbies Squishdot
 about
 search
 post article
 Documentation
 Mailing Lists
 Bug Tracking
 Development
 Installation
 Upgrading
 Download
 admin
 rdf

 main


Displaying Attachments by type.
Squishdot Posted by Tom on Saturday September 06, 09:32PM, 2003
from the dept.
I've seen a thread about displaying images using <img src="&dtml.url-file;">, which works, but is there a way to determine if the file is actually an image?

I've tried using <dtml-var "meta-type">, but it returns only "Squishdot File" as the type. I also tried <dtml-var expr="file_name[0,4]"> to get the file extension and use that as the basis for whether or not to use the img tag, but it returns an "unscriptable object" error. Any ideas, suggestions? Thanks in advance. Tom

<  |  >

 

Related Links
  • Articles on Squishdot
  • Also by Tom
  • Contact author
  • The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    This should work ;-)
    by Chris Withers on Wednesday September 10, 11:37AM, 2003
    <dtml-if "file.content_type.startswith('image')">
    <img src="&dtml.url-file;">
    </dtml-if>
    [ Reply to this ]
    Re: Displaying Attachments by type.
    by Tom on Friday September 12, 01:33AM, 2003
    Thank you!!! P.S. Let me know if you need any help with Swishdot, designwise. http://www.modscape.com/blog/extra/open_source_design_html
    [ Reply to this ]
    • :-)
      by Chris Withers on Wednesday September 17, 02:19PM, 2003
      Thanks Tom!

      I'll let you know when you can help...

      Chris
      [ Reply to this ]

     
    The Fine Print: The following comments are owned by whoever posted them.
    ( Reply )

    Powered by Zope  Squishdot Powered
      "Any system that depends on reliability is unreliable." -- Nogg's Postulate
    All trademarks and copyrights on this page are owned by their respective companies. Comments are owned by the Poster. The Rest ©1999 Butch Landingin, ©2000-2002 Chris Withers.