Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

check existing file 1

Status
Not open for further replies.

discusmania

IS-IT--Management
Oct 24, 2000
158
AP
hello.....
I've create an upload feature. the problem is i want the system to be able to check whether there is a file in the server with the same name with the the file they want to upload. If yes, the user will get the option whether to overwrite it or change the file name.

Thanks....
 
if you are using IIS you can do it using the FSO (filesystemobject) as follows (this is VBscript):

Set fs = CreateObject("Scripting.FileSystemObject")
if fs.FileExists(filespec) then
THE FILE EXISTS
else
THE DOESN'T EXIST
end if

where filespec is the full path to the file that you are looking for. (you may find the server.mappath() method useful here)

It's up to you how you want to notify the user and proceed from here...

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top