uploading unique documents -
09-28-2006
, 02:41 PM
I'm uploading documents and I want to do two things.
1. Only upload .doc files
2. I'm applying the Session.SessionID to the Filename to give it
uniqueness. Is this approach logical?
<script language="c#" runat="server">
void UploadFile_Clicked(Object src, EventArgs E)
{
string FileName;
string uploadDirectory = "C:\\Resumes\\";
FileName=uploadFile.PostedFile.FileName;
FileName=Path.GetFileName(FileName);
//restricting users to only upload .doc files.
uploadFile.PostedFile.SaveAs(uploadDirectory + Session.SessionID
+FileName);
UploadFormPanel.Visible = false;
uploadedFileInfoPanel.Visible = true;
}
</script> |