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
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