Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

asp detect file?

  • 05-08-2003 8:50am
    #1
    Registered Users, Registered Users 2 Posts: 1,747 ✭✭✭


    I have a preview system up and running on the dgi site at the moment here: http://www.dgi.ie/polls/t-shirt.asp

    If you click on the thumbnail up pops a larger version showing images numbered 1 - 48.
    on the pop up page i have this code:



    <img src="../designs/large/design<%=id%>.gif" alt="T-shirt design 01" width="425" height="600" />

    <a href="close_up.asp?id=<%=id-1%>"><< previous</a>

    <a href="close_up.asp?id=<%=id+1%>">next >></a>



    next goes up a number and previous goes down a number etc.

    What code can i put in the page so that it can detect if an image exists before going on to the next one?
    eg. im on design48.gif and i press next. Code does not detect design49.gif so stay on current page.

    At the moment i just have an image telling people to turn back.


Comments

  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Try try something like this:
    Dim objImage, strImagePath
    
    Set objImage = Server.CreateObject("Scripting.FileSystemObject")
    strImagePath = Server.MapPath("../designs/large/design" & CStr(id + 1) & ".gif"
    If objImage.FileExists(strImagePath)) Then
    	'Next Image Exists (Output link to buffer)
    Else
    	'Next Image does not Exist (Don't output link to buffer)
    End If
    Set objImage = Nothing
    


  • Registered Users, Registered Users 2 Posts: 266 ✭✭car


    how do u set up an ado connection to a database


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by car
    how do u set up an ado connection to a database
    Why don't you start a new thread and ask rather than going off topic in an existing thread?

    Better still, STFW...


Advertisement