Thanks for that =Brian.I didn't use your code exactly but it reminded =me to wrap the condition in [url][/url] in my [showif]. Once I did that =it worked =fine.CheersPaul
=On 2 May 2011, at 19:59, Brian Fries =wrote:=div>What WebDNA "should" do =is far less important than what WebDNA "does" do, and WebDNA does return =an error if the specified file name is not found.Try =this as a way to handle this error =message:[text]tFileList=3D=[listfiles path=3Dimages&name=3D-[serialno].jpg&exact=3DF]=<img src=3D"images/[filename]">=[/listfiles][/text][if "[url][tFileList][/url]"^"FileNotFound"][then]=No files found for serial number [serialno]<br>[/then][else]=[tFileList][/else][/if]- BrianOn May 2, =2011, at 10:16 AM, Paul Willis wrote:Hi
I have a folder of images that are named in =the format...
random_names-XXX.jpg
Where XXX is a serial =number for a record in a database
I don't know what the ='random_names' bit is but it doesn't contain anything other than letters =an underscores. The filename always ends in hyphen serial number =.jpg
When I pull a record from the database I want to do a =listfiles on the image folder and see if one of them ends in the serial =number.
Using...
[listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df]
<img =src=3D"images/[filename]">
[/listfiles]
...works fine when =I have a matching image but I get an error message if there is no =matching image file like...
An unknown error =occurred:
FileNotFound
-30.jpg
I've tried hiding the =listfiles inside a showif with another listfiles but it doesn't work, =the error still shows...
[showif [listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df][isfile][/listfiles=]=3DT]
=[listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df]
<img =src=3D"images/[filename]">
=[/listfiles]
[/showif]
...I'm on WebDNA 6.0a on Mac OS =X Server 10.4.11
What am I doing wrong here? Shouldn't =[listfiles] just show nothing is it doesn't find a =match?
Paul=--Apple-Mail-14--339225051-- Associated Messages, from the most recent to the oldest:<=/span>- =Govinda--------------Old WebDNA =talklist =archives:http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwe=bdna-talk
--Apple-Mail-14--339225051Content-Transfer-Encoding: quoted-printableContent-Type: text/plain;charset=us-asciih=ttp://mail.webdna.us/list/talk@webdna.us?cmd=3Duser_listview_msg&domainid=3D=161&list=3Dtalk&msg_idx=3D4900&popup=3Dtrue&doframes=3Dfalse> Thanks for that Brian.>=20> I didn't use your code exactly but it reminded me to wrap the =condition in [url][/url] in my [showif]. Once I did that it worked fine.>=20> Cheers>=20> Paul>=20>=20> On 2 May 2011, at 19:59, Brian Fries wrote:>=20>> What WebDNA "should" do is far less important than what WebDNA "does" =do, and WebDNA does return an error if the specified file name is not =found.>>=20>> Try this as a way to handle this error message:>>=20>> [text]tFileList=3D>> [listfiles path=3Dimages&name=3D-[serialno].jpg&exact=3DF]>>
- Re: [WebDNA] listfiles problem (Govinda
2011) - Re: [WebDNA] listfiles problem (Paul Willis
2011) - Re: [WebDNA] listfiles problem (Brian Fries
2011) - [WebDNA] listfiles problem (Paul Willis
2011) >> [/listfiles]>> [/text]>>=20>> [if "[url][tFileList][/url]"^"FileNotFound"][then]>> No files found for serial number [serialno]
>> [/then][else]>> [tFileList]>> [/else][/if]>>=20>>=20>> - Brian>>=20>> On May 2, 2011, at 10:16 AM, Paul Willis wrote:>>=20>>> Hi>>>=20>>> I have a folder of images that are named in the format...>>>=20>>> random_names-XXX.jpg>>>=20>>> Where XXX is a serial number for a record in a database>>>=20>>> I don't know what the 'random_names' bit is but it doesn't contain =anything other than letters an underscores. The filename always ends in =hyphen serial number .jpg>>>=20>>> When I pull a record from the database I want to do a listfiles on =the image folder and see if one of them ends in the serial number.>>>=20>>> Using...>>>=20>>> [listfiles path=3Dimages&name=3D-[serialno].jpg&exact=3Df]>>>>>> [/listfiles]>>>=20>>> ...works fine when I have a matching image but I get an error =message if there is no matching image file like...>>>=20>>> An unknown error occurred:>>> FileNotFound>>> -30.jpg>>>=20>>> I've tried hiding the listfiles inside a showif with another =listfiles but it doesn't work, the error still shows...>>>=20>>> [showif [listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df][isfile][/listfiles]=3DT]>>> [listfiles path=3Dimages&name=3D-[serialno].jpg&exact=3Df]>>>
>>> [/listfiles]>>> [/showif]>>>=20>>> ...I'm on WebDNA 6.0a on Mac OS X Server 10.4.11>>>=20>>> What am I doing wrong here? Shouldn't [listfiles] just show nothing =is it doesn't find a match?>>>=20>>> Paul- Govinda--------------Old WebDNA talklist archives:http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwebdna-talk--Apple-Mail-14--339225051Content-Transfer-Encoding: quoted-printableContent-Type: text/html;charset=us-asciihttp://mail.webdna.us/list/talk@webdna.us?cmd=3Duser_li=stview_msg&domainid=3D161&list=3Dtalk&msg_idx=3D4900&popup==3Dtrue&doframes=3Dfalse
Thanks for that =Brian.I didn't use your code exactly but it reminded =me to wrap the condition in [url][/url] in my [showif]. Once I did that =it worked =fine.CheersPaul
=On 2 May 2011, at 19:59, Brian Fries =wrote:=div>What WebDNA "should" do =is far less important than what WebDNA "does" do, and WebDNA does return =an error if the specified file name is not found.Try =this as a way to handle this error =message:[text]tFileList=3D=[listfiles path=3Dimages&name=3D-[serialno].jpg&exact=3DF]=<img src=3D"images/[filename]">=[/listfiles][/text][if "[url][tFileList][/url]"^"FileNotFound"][then]=No files found for serial number [serialno]<br>[/then][else]=[tFileList][/else][/if]- BrianOn May 2, =2011, at 10:16 AM, Paul Willis wrote:Hi
I have a folder of images that are named in =the format...
random_names-XXX.jpg
Where XXX is a serial =number for a record in a database
I don't know what the ='random_names' bit is but it doesn't contain anything other than letters =an underscores. The filename always ends in hyphen serial number =.jpg
When I pull a record from the database I want to do a =listfiles on the image folder and see if one of them ends in the serial =number.
Using...
[listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df]
<img =src=3D"images/[filename]">
[/listfiles]
...works fine when =I have a matching image but I get an error message if there is no =matching image file like...
An unknown error =occurred:
FileNotFound
-30.jpg
I've tried hiding the =listfiles inside a showif with another listfiles but it doesn't work, =the error still shows...
[showif [listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df][isfile][/listfiles=]=3DT]
=[listfiles =path=3Dimages&name=3D-[serialno].jpg&exact=3Df]
<img =src=3D"images/[filename]">
=[/listfiles]
[/showif]
...I'm on WebDNA 6.0a on Mac OS =X Server 10.4.11
What am I doing wrong here? Shouldn't =[listfiles] just show nothing is it doesn't find a =match?
Paul=--Apple-Mail-14--339225051-- Govinda<=/span>- =Govinda--------------Old WebDNA =talklist =archives:http://dev.webdna.us/TalkListArchive/index.tpl?db=3Dwe=bdna-talk
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
Fun with Dates - revisited (1997) Banner DNA (1997) Search Context Strips URL chrs.? (1999) multi-paragraph fields (1997) Virtual hosting and webcatNT (1997) [WebDNA] I got v7 running on 64-bit Ubuntu 11.04 ... (2012) Two prices in shoppingcart? (1997) [quantity] within formulas (1997) Secure server question (1997) Authorize.net setup (2002) Bulletin Board (1998) Loop into field (1998) Comments in db? (1997) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) how to do multiple prices/item? (1998) Table code broken? (2004) Cancel Subscription (1996) WebCatalog for guestbook ? (1997) Robert Minor duplicate mail (1997) WebCatalog for guestbook ? (1997)