Re: [WebDNA] listfiles problem

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106595
interpreted = N
texte = --Boundary_(ID_y4hIJgT6MU/4rnwN2rB3ZQ) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT 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. Cheers Paul On 2 May 2011, at 19:59, Brian Fries wrote: > 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= > [listfiles path=images&name=-[serialno].jpg&exact=F] >  > [/listfiles] > [/text] > > [if "[url][tFileList][/url]"^"FileNotFound"][then] > No files found for serial number [serialno]
> [/then][else] > [tFileList] > [/else][/if] > > > - Brian > > On 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=images&name=-[serialno].jpg&exact=f] >> >> [/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=images&name=-[serialno].jpg&exact=f][isfile][/listfiles]=T] >> [listfiles path=images&name=-[serialno].jpg&exact=f] >>  >> [/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 >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> > > --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --Boundary_(ID_y4hIJgT6MU/4rnwN2rB3ZQ) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable 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.

Cheers

Paul

=

On 2 May 2011, at 19:59, Brian Fries = wrote:

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]


- Brian

On 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
----------------------------------------------------= -----
This message is sent to you because you are subscribed = to
the mailing list <talk@webdna.us>.
To = unsubscribe, E-mail to: <talk-leave@webdna.us>
archi= ves: http://mail.webdna.us/l= ist/talk@webdna.us
Bug Reporting: support@webdna.us


--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Boundary_(ID_y4hIJgT6MU/4rnwN2rB3ZQ)-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] listfiles problem (Govinda 2011)
  2. Re: [WebDNA] listfiles problem (Paul Willis 2011)
  3. Re: [WebDNA] listfiles problem (Brian Fries 2011)
  4. [WebDNA] listfiles problem (Paul Willis 2011)
--Boundary_(ID_y4hIJgT6MU/4rnwN2rB3ZQ) Content-type: text/plain; CHARSET=US-ASCII Content-transfer-encoding: 7BIT 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. Cheers Paul On 2 May 2011, at 19:59, Brian Fries wrote: > 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= > [listfiles path=images&name=-[serialno].jpg&exact=F] >  > [/listfiles] > [/text] > > [if "[url][tFileList][/url]"^"FileNotFound"][then] > No files found for serial number [serialno]
> [/then][else] > [tFileList] > [/else][/if] > > > - Brian > > On 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=images&name=-[serialno].jpg&exact=f] >> >> [/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=images&name=-[serialno].jpg&exact=f][isfile][/listfiles]=T] >> [listfiles path=images&name=-[serialno].jpg&exact=f] >>  >> [/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 >> --------------------------------------------------------- >> This message is sent to you because you are subscribed to >> the mailing list . >> To unsubscribe, E-mail to: >> archives: http://mail.webdna.us/list/talk@webdna.us >> Bug Reporting: support@webdna.us >> > > --------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us --Boundary_(ID_y4hIJgT6MU/4rnwN2rB3ZQ) Content-type: text/html; CHARSET=US-ASCII Content-transfer-encoding: quoted-printable 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.

Cheers

Paul

=

On 2 May 2011, at 19:59, Brian Fries = wrote:

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]


- Brian

On 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
----------------------------------------------------= -----
This message is sent to you because you are subscribed = to
the mailing list <talk@webdna.us>.
To = unsubscribe, E-mail to: <talk-leave@webdna.us>
archi= ves: http://mail.webdna.us/l= ist/talk@webdna.us
Bug Reporting: support@webdna.us


--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/l= ist/talk@webdna.us Bug Reporting: support@webdna.us

= --Boundary_(ID_y4hIJgT6MU/4rnwN2rB3ZQ)-- Paul Willis

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:

Help name our technology! (1997) Bug Report, maybe (1997) Single Link browsing (1997) setlineitem quantity to zero? (2000) Mail Server Needed. (1998) Text data with spaces in them... (1997) WebCat2.0 [format thousands .0f] no go (1997) Only charge card when product shipped ? (1997) Getting Total Quantity (1997) Snake Bites (1997) webcatalog approaching max (1998) emptying shopping carts and orders folder (2004) [WebDNA] WebDNA app, Terry (2013) OLD PROBLEM (1997) New reserved words for [tags] (2000) Carrying over data? (1997) [shell] (2002) Hiding HTML and page breaks (1997) Protect vs Authenicate (1997) [date] insanity! (2001)