Hi Brian,
I think you should first upload the file to the library and then update its properties. Adding a new list item first will probably not work.
Based on your code I've slightly adapted it to what I think should work (without having actually tried out the code so no promises here):
if (htmlFileUpload.PostedFile != null)
{
int found;
string libraryName = "Employee Availability Resumes";
string fileExt = "";
string destUrl = strDocLibUrl;
string uploadedFile = htmlFileUpload.PostedFile.FileName;
found = uploadedFile.IndexOf(".");
fileExt = uploadedFile.Substring(found).Trim();
using (SPWeb web = new SPSite(destUrl).OpenWeb())
{
try
{
SPList list = web.Lists[libraryName];
if (list != null)
{
web.AllowUnsafeUpdates = true;
Stream fStream = htmlFileUpload.PostedFile.InputStream;
byte[] contents = new byte[fStream.Length];
fStream.Read(contents, 0, (int)fStream.Length);
fStream.Close();
fStream.Dispose();
string fileName = Path.GetFileName(htmlFileUpload.PostedFile.FileName);
SPFile newFile = list.RootFolder.Files.Add(fileName, contents, true);
Hashtable fileProps = file.Properties;
fileProps["Employee Number"] = txtEmpNo.Text;
fileProps["Tracking ID"] = strTrackingId;
file.Update();
web.AllowUnsafeUpdates = false;
}
return true;
}
catch (System.Exception exc)
{
//error handling}
}
}
}