Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    Oregon, United States of America
    Posts
    882
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Does an image exist?

    I need to use ASP to check if a file exists. If it does, i just need to put it on the screen, if not, i need to put a "Image Not Found" image on the screen.

    How do i do this in ASP. This is easy in PHP, but i'm new to ASP.

    Thank you.
    If I'm postin here, I NEED YOUR HELP!!

  • #2
    dev
    dev is offline
    New Coder
    Join Date
    Jan 2007
    Posts
    28
    Thanks
    0
    Thanked 0 Times in 0 Posts
    u can use the Scripting.FileSystemObject .
    create an object of that and use the properties or methods .

    u hv a FileExists() method with which u can check for the existence of the image or any file .if not u can display the "Image Not Found" message.

    thanks
    dev
    Last edited by dev; 01-06-2007 at 10:44 AM. Reason: add some more msg

  • #3
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is the image in the filesystem or a database?

    http://www.w3schools.com/asp/asp_ref_filesystem.asp


    If it is in a database then you can query for the image and check the status using EOF
    Or if you have a full list then you can check if a row is empty or null


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •