PDA

View Full Version : checking if image exists


Baleric
09-04-2006, 06:05 AM
hey guys,
im running the freeaspupload script and was wondering how i would check if the image i am uploading already exists on the server and if it does then either the image name changes or a message comes up prompting you to change the name of the file.

where would i start?
how would i do this?

thanks in advance for any advice or help.

cheers

baleric

Wylie
09-04-2006, 06:42 AM
I am not family of this, but give you some hint. You have to start of FileSystemObject. Example below:


Dim fileObj
Set fileObj = CreateObject("Scripting.FileSystemObject")

If fileObj.FileExists("c:\wwwroot\image.jpg") = True Then
Response.Write("existed file")
End If
Set fileObj = Nothing


PS. I am not sure this work...:p

Baleric
09-05-2006, 02:20 AM
thanks for your help wylie, ill give it a go and get back to you.
im not sire where ill have to insert this code but ill have to try,

cheers