HttpFileCollection fileCollection = Request.Files; for (int i = 0; i < fileCollection.Count; i++) { HttpPostedFile uploadfile = fileCollection[i]; string file = Path.GetFileName(uploadfile.FileName); string extension = Path.GetExtension(file); if (uploadfile.ContentLength > 0) { string no = Guid.NewGuid().ToString().Substring(0, 4); string path = @"../Gallery/"; string serverpath = Server.MapPath(path); string fullpath = serverpath + no + file; uploadfile.SaveAs(fullpath); valid += file + " saved successfully\\n"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)