以下代码传输文件成功,但未在标签中打印已传输。尽管其他检查显示完美。这里面有什么逻辑错误吗?
if (txtFile1.HasFile)
{
var folderfile1 = Server.MapPath("~/files/Operations_Support/IMSI");
string flFile1 = txtFile1.PostedFile.FileName;
string saveflFile1 = folderfile1 + "\\" + System.IO.Path.GetFileName(flFile1);
FileInfo Finfo = new FileInfo(txtFile1.PostedFile.FileName);
if (Finfo.Extension.ToLower() == ".txt")
{
if (txtFile1.PostedFile.ContentLength < 1024)
{
//if (!File.Exists(folderfile1))
if (Directory.GetFiles(folderfile1).Length == 0)
{
txtFile1.SaveAs(saveflFile1);
//lbFile1.Visible = true;
lbFile1.Text = "Upload status: IMSI file transfered successfully";
}
else
{
lbFile1.Text = "Upload status: Please wait until the previous file is processed";
}
}
else
lbFile1.Text = "Upload status: The file has to be less than 1 kb!";
}
else
lbFile1.Text = "Upload status: Only Text files are accepted!";
}
else
{
lbFile1.Visible = true;
lbFile1.Text = "Upload status: Please select file";
}