User1754914522 posted
Hi all,
File upload is not a required field, so if it has file then it needs to be checked that already exists on the server side, if not then it should write to the server. I used the code whcih was used before, but not sure how to to check if the upload
has file.
string
physicalFolder = "C://Sample/temp//";
string
Filename = FileUpload1.FileName;
if
(FileUpload1.HasFile)
{
string
PathtoCheck = physicalFolder + FileUpload1.FileName;
if
(System.IO.File.Exists(PathtoCheck) )
{
}
FileUpload1.SaveAs(physicalFolder + FileUpload1.FileName);
}
on the client side, am using this
<
td
align="center"
class="style3"
colspan
="3">
<%
if
(System.IO.File.Exists(PathtoCheck)) %>
<%{ %>
<asp:Button
ID="Button2"
runat="server"
onclick="Button2_Click"
Text="Submit"
OnClientClick="return
confirm('Are you certain you want to do what you want to do?');"/><%} %> />
</td>,
but this gives an error saying PathToCheck doesn't exist
Thanks for any help