Upload Resource By FileUpload control

string strImage = uploadImage(anyStringValueTogivetheFileNameTobeUploaded);
private string uploadImage(string strid)//for uploading small image
{
string fileName = "";
string strSimg = "";
Random randObj = new Random();
fileName = Path.GetFileName(FileUploadControlId.Value);
if (fileName != string.Empty)

{
// string strExist = Server.MapPath("~/Upload_smallimg/"++) + "/" + fileName;

string strExist = Server.MapPath("~/Upload_smallimg/" + fileName);
//"~/Upload_smallimg/"=folder path where file will be uploaded inside Application
if (File.Exists(strExist))

{
lblmsg.Text = "ANY TEXT"
}
else
{
string strName = Path.GetFileNameWithoutExtension(fileName) + "_S" + strid + randObj.Next(100).ToString();
string strext = Path.GetExtension(fileName);
string strimgPath = Server.MapPath(ConfigurationManager.AppSettings["image"].ToString()) + strName + strext;
FileUploadControlId.SaveAs(strimgPath);
strSimg = strName + strext;
}
}
return strSimg;
}