Hi, On 22/06/11 21:20, Summer wrote: > hmm. I tried it, but getting some errors. I know the file exists cause > I am looking on the server. > > If I use the relative path, I get: > file error - /xml/national.xml: No such file or directory at > /app/shared/lib/perl/Cntrl.pm line 285 > > If I use the absolute path, I get: > file error - no providers for file prefix 'http' at > /app/shared/lib/perl/Cntrl.pm line 285 > any other possible tt tricks to get the file info? >
Is the template on the same server as the XML file, or are you trying to check a file on a remote server? If it's on the same server, make sure it's in a path that the template can read from (the ABSOLUTE and RELATIVE options will affect this, for example), at the moment it sounds like you're trying to read it from the external URL. If it's on a remote server, you could do a HEAD request to verify that the file exists and is non-zero size but if you're going to process the data anyway then this is unlikely to gain anything, just issue a GET request for the file - you can't magically tell whether a file is present on the server without issuing some sort of request. cheers, Tom _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates
