Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 images
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 19 May 2001 :  08:19:48  Show Profile
Is there a way, using ASP (JScript), to determine if an image file exists or not, before attempting to load it

http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com

BuffyNET
Junior Member

United Kingdom
126 Posts

Posted - 19 May 2001 :  08:27:08  Show Profile  Visit BuffyNET's Homepage  Send BuffyNET an ICQ Message
You can use the File Scripting Object to see if the file exists, can't remember the exact code right now, but will look it up for you

<BUMP>


Neil

Edited by - BuffyNET on 19 May 2001 14:46:55
Go to Top of Page

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 19 May 2001 :  14:08:11  Show Profile
Thanks a lot

http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com
Go to Top of Page

RaiderUK
Average Member

United Kingdom
577 Posts

Posted - 19 May 2001 :  21:17:52  Show Profile  Send RaiderUK a Yahoo! Message
try this:

Set exist=Server.CreateObject("Scripting.FileSystemObject")

If (exist.FileExists("c:\filename")) = true Then
' Do something
Else
' Do something
End If

set exist = nothing



Edited by - RaiderUK on 19 May 2001 21:19:13
Go to Top of Page

redbrad0
Advanced Member

USA
3725 Posts

Posted - 20 May 2001 :  01:35:33  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
you dont even have to put the = True, by default its = true. so here is some samples....


Set exist=Server.CreateObject("Scripting.FileSystemObject")

If (exist.FileExists("c:\filename")) Then
' The file is there
Else
' The file was not found
End If

If not (exist.FileExists("c:\filename")) Then
' The file was not found
Else
' The file is there
End If


Brad
Go to Top of Page

GBurch
Junior Member

United Kingdom
107 Posts

Posted - 20 May 2001 :  05:21:58  Show Profile
That code looks a lot more like VBScript than JScript

http://www.captgb.dabsol.co.uk
http://www.slipstreamservices.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.29 seconds. Powered By: Snitz Forums 2000 Version 3.4.07