Hello,
I am moving a file to a folder as follows:
Dim file As New System.IO.FileInfo(Server.MapPath(path))
file.MoveTo(Server.MapPath(newpath))
This is working but if there is already a file with the same name in
the destination folder I get an error.
I would like to replace the file if one exists.
How can I do this?
Thanks,
Miguel
Jonas Bush - 16 Feb 2008 06:03 GMT
I think you'd have to use file.CopyTo(newpath, true) to overwrite an
existing file, and then use file.Delete() to delete the original.
Jonas
> Hello,
>
[quoted text clipped - 12 lines]
> Thanks,
> Miguel