Check if picture(url) exists

Using Servoy to administrate the content of your website? Discuss all webrelated Servoy topics on this forum!

Check if picture(url) exists

Postby Janssenjos » Mon Dec 13, 2010 3:56 pm

Hi,

We need to display pictures on our web_client. We want to do it as followed:
There is 1 main picture, that always exitst (like www.pictures.nl\product.jpg)
There could be more pictures, they will have the format like product_1.jpg, product_2.jpg etc.. But only the pictures that exist should be shown.

Is there a way in servoy, to detect if a picture on an url like ( www.pictures.nl\product_1.jpg) exists?

Thanks.
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Check if picture(url) exists

Postby Joas » Mon Dec 13, 2010 4:02 pm

You can do:
Code: Select all
var result = plugins.http.getMediaData("http://www.pictures.nl/product_1.jpg");
and check the result.
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: Check if picture(url) exists

Postby Janssenjos » Mon Dec 13, 2010 5:41 pm

Thanks,

That did the trick.
Jos Janssen
Software Developer
Axerrio
http://www.axerrio.com
Janssenjos
 
Posts: 148
Joined: Thu Aug 13, 2009 3:55 pm
Location: Bergen op Zoom

Re: Check if picture(url) exists

Postby bcusick » Thu Dec 30, 2010 3:07 pm

Good code tip!

Servoy - just ROCKS!
Bob Cusick
bcusick
 
Posts: 1255
Joined: Wed Apr 23, 2003 11:27 pm
Location: Thousand Oaks, CA USA


Return to Web Development

Who is online

Users browsing this forum: No registered users and 7 guests

cron