Hi All,
I am facing an issue with uploading file, When I try to upload attachment from server with the below code the attachment uploaded successfully, but when I try to upload outside the server, it is throwing the exception "Can't find the path".
string strFileName = txtPath.Text;
FileStream stream = new FileStream(txtPath.Text, FileMode.Open, FileAccess.Read); // Exception thrown here
byte[] byteArray = new byte[stream.Length];
stream.Read(byteArray, 0, Convert.ToInt32(stream.Length));
stream.Close();
requestItem.Attachments.Add(strFileName, byteArray);
Please help me on this issue.
Regards,
Kumar.
I am facing an issue with uploading file, When I try to upload attachment from server with the below code the attachment uploaded successfully, but when I try to upload outside the server, it is throwing the exception "Can't find the path".
string strFileName = txtPath.Text;
FileStream stream = new FileStream(txtPath.Text, FileMode.Open, FileAccess.Read); // Exception thrown here
byte[] byteArray = new byte[stream.Length];
stream.Read(byteArray, 0, Convert.ToInt32(stream.Length));
stream.Close();
requestItem.Attachments.Add(strFileName, byteArray);
Please help me on this issue.
Regards,
Kumar.