private void UploadCert(string VendorCode) { HttpFileCollection uploads; uploads = HttpContext.Current.Request.Files; int countfiles = 0; for (int i = 0; i <= (uploads.Count - 1); i++) { if (uploads[i].ContentLength > 0) { string c = Path.GetFileName(uploads[i].FileName); string cNoSpace = c.Replace(" ", "-"); string c1 = cNoSpace; string strPath = bll.GetFileApplicationPath(VendorCode); DirectoryInfo dic = new DirectoryInfo(strPath); bll.EmptyFolder(dic); string fullPath = strPath + "\\" + c1; FileUpload1.PostedFile.SaveAs(fullPath); } } }