Re: Checking whether remote image exists?

This WebDNA talk-list message is from

2004


It keeps the original formatting.
numero = 58711
interpreted = N
texte = Mark, It wouldn't be as 'lilve' but you might want to have a process that checks for your remote images say once per hour or something then set a flag in a database (if that is where you are keeping a reference to the file name) to not that it is available remotely. That way you wouldn't have to do the check each time the image is requested. You could also have another flag based on a more frequent check that the remote server itself is up and responding to requests. That way if the remote server is responding and the image is remote than serve remotely. If the remote server is not responding, then serve locally or if the image is not remote also serve locally. Mark Derrick wrote: > I guess the subject says it all, I have a large number of images stored > on an off-site (non-WebDNA) server, and I'd like my pages to check > whether the image exists, and if it doesn't then display a generic image > instead. > > Here's what I've come up with, as always, I'm sure there's an easier way > to do it. :-) > > [text]ImageResult=[shell]CURL > images.domain.com/images/[image].jpg][/shell][/text] > [showif [ImageResult]^Not Found][text]ImageCheck=failed[/text][/showif] > [if "[ImageCheck]" = "failed"] > [then][/then] > [else][/else] > [/if] > > This is running under v6/OSX > > Anyone doing anything similar? > My knowledge of Unix is still a little sparse, is there a better command > than CURL for this kind of thing? > > > Mark. ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Checking whether remote image exists? ( eLists 2004)
  2. Checking whether remote image exists? ( Mark Derrick 2004)
Mark, It wouldn't be as 'lilve' but you might want to have a process that checks for your remote images say once per hour or something then set a flag in a database (if that is where you are keeping a reference to the file name) to not that it is available remotely. That way you wouldn't have to do the check each time the image is requested. You could also have another flag based on a more frequent check that the remote server itself is up and responding to requests. That way if the remote server is responding and the image is remote than serve remotely. If the remote server is not responding, then serve locally or if the image is not remote also serve locally. Mark Derrick wrote: > I guess the subject says it all, I have a large number of images stored > on an off-site (non-WebDNA) server, and I'd like my pages to check > whether the image exists, and if it doesn't then display a generic image > instead. > > Here's what I've come up with, as always, I'm sure there's an easier way > to do it. :-) > > [text]ImageResult=[shell]CURL > images.domain.com/images/[image].jpg][/shell][/text] > [showif [ImageResult]^Not Found][text]ImageCheck=failed[/text][/showif] > [if "[ImageCheck]" = "failed"] > [then][/then] > [else][/else] > [/if] > > This is running under v6/OSX > > Anyone doing anything similar? > My knowledge of Unix is still a little sparse, is there a better command > than CURL for this kind of thing? > > > Mark. ------------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://webdna.smithmicro.com/ eLists

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:

WebCat2b13MacPlugIn - [include] (1997) InSecureTextVariables.... (2000) Record size (1998) [WebDNA] Two different mail servers? (2011) Locking up with WebCatalog... (1997) [format xs] freeze (1997) RE: [taxRate] [TaxTotal] ? (1997) Multiple Merchant Accounts? (1997) archiving images (2006) Moment of Thanks (1997) Help name our technology! (1997) Bug? (1997) Nested vs conditional (1997) WebSTAR plugin update (2004) Most Efficiant Way to do restricted Areas (1997) Re:2nd WebCatalog2 Feature Request (1996) error: Too many nested [xxx] contexts (1997) Proper file locations (1997) [OT] (waaaay OT) (2004) Items XX to XX shown (1997)