File IO question with a web application

Discussion in 'ASP .Net' started by Paul, Jul 24, 2008.

  1. Paul

    Paul Guest

    Hi I have a web application that uploads files to the server which is
    working. A minor issue is that if the file already exists I get the error
    file.doc already exists.
    Just wondering if there is a way to have it automatically replace the file
    and not produce the error?
    thanks.
    --
    Paul G
    Software engineer.
     
    Paul, Jul 24, 2008
    #1
    1. Advertising

  2. Paul

    Munna Guest

    hi,

    first check if the file already exists or not...
    if exists give the user option to choose between replace or not...
    if user chooses replace delete the previous file and then upload the
    file...

    best of luck


    Munna
     
    Munna, Jul 24, 2008
    #2
    1. Advertising

  3. Paul

    Paul Guest

    Hi, thanks for the response. I will give it a try. I think the method you
    have described will work well for my application as in some cases the file
    path is just a path to a directory or a URL, so in those cases there are no
    files to delete.
    --
    Paul G
    Software engineer.


    "Munna" wrote:

    > hi,
    >
    > first check if the file already exists or not...
    > if exists give the user option to choose between replace or not...
    > if user chooses replace delete the previous file and then upload the
    > file...
    >
    > best of luck
    >
    >
    > Munna
    >
     
    Paul, Jul 24, 2008
    #3
  4. I recently dealt with this. I simply deleted the existing file.

    --
    Jonathan Wood
    SoftCircuits Programming
    http://www.softcircuits.com

    "Paul" <> wrote in message
    news:...
    > Hi I have a web application that uploads files to the server which is
    > working. A minor issue is that if the file already exists I get the error
    > file.doc already exists.
    > Just wondering if there is a way to have it automatically replace the file
    > and not produce the error?
    > thanks.
    > --
    > Paul G
    > Software engineer.
     
    Jonathan Wood, Jul 25, 2008
    #4
  5. Paul

    Paul Guest

    ok, thanks for the additional information.
    --
    Paul G
    Software engineer.


    "Jonathan Wood" wrote:

    > I recently dealt with this. I simply deleted the existing file.
    >
    > --
    > Jonathan Wood
    > SoftCircuits Programming
    > http://www.softcircuits.com
    >
    > "Paul" <> wrote in message
    > news:...
    > > Hi I have a web application that uploads files to the server which is
    > > working. A minor issue is that if the file already exists I get the error
    > > file.doc already exists.
    > > Just wondering if there is a way to have it automatically replace the file
    > > and not produce the error?
    > > thanks.
    > > --
    > > Paul G
    > > Software engineer.

    >
    >
     
    Paul, Jul 28, 2008
    #5
    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. human
    Replies:
    1
    Views:
    345
    human
    Jul 6, 2003
  2. Sean
    Replies:
    2
    Views:
    520
  3. Guest
    Replies:
    1
    Views:
    2,494
    Alvin Bruney
    Nov 2, 2003
  4. Lloyd Sheen
    Replies:
    1
    Views:
    350
    Lloyd Sheen
    Nov 15, 2007
  5. Andy B
    Replies:
    0
    Views:
    289
    Andy B
    Aug 13, 2008
Loading...

Share This Page