-1

after upload the file then upload button click it shows the msg if already file exits do you want overwrite it? here i used the popup and cancel control id but i want use ok button and then press the ok button load the file and overrite the old one how to write the code in asp.net using c#

4

1 回答 1

0

对于检查存在文件,您可以使用此代码

var folderfile4 = Server.MapPath("~/files/Path");
string saveflFile4 = folderfile4 + "\\" + System.IO.Path.GetFileName(flFile4);
if(!File.Exists(saveflFile4))
    txtFile4.SaveAs(saveflFile4);
else
    txtError.Text = "File exists";
于 2013-02-18T17:01:58.757 回答