file system object

Discussion in 'ASP General' started by usura, Aug 22, 2004.

  1. usura

    usura Guest

    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
     
    usura, Aug 22, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kathy Burke
    Replies:
    2
    Views:
    5,149
    Kevin Spencer
    Aug 1, 2003
  2. Showjumper
    Replies:
    2
    Views:
    1,815
    Showjumper
    Aug 2, 2003
  3. Imran Aziz
    Replies:
    4
    Views:
    8,716
    ljenner01
    Jan 19, 2011
  4. keithb
    Replies:
    3
    Views:
    18,619
    =?ISO-8859-1?Q?G=F6ran_Andersson?=
    May 7, 2006
  5. Replies:
    0
    Views:
    894
Loading...

Share This Page