file system object

U

usura

Hi

I am building an upload script that overwrites any file with the same name,
however the file could be a jpg, gif, bmp etc

Using 'fso.FileExists ' i can find if a file of the same name exists and
remove it. The file will be saved as strMemberId.strFileExt

There is a possibility that file xyz.jpg may be re-uploaded as xyz.gif thus
while the new image will be written to the folder the previous file will not
be removed.

I am trying to find the best way of finding the file name of a file without
the extension so I can delete any files that may exist with the same name
but a have different extension. Is there a way of calling a wildcard in asp?


eg ' fso.FileExists(Server.MapPath("../tempfolder/" & strMemberId &".*" ))
' - tried this & several other combinations but it does not work.

The only other way I can see of doing it is to pass the file name into a
string, strip the extension off it and then build an array to loop through
the possible extensions but I am sure there is a better way.

Any thoughts?

Thanks In advance

J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top