System.Web.UI.WebControls.FileUpload inputFile; inputFile = this.FileUpload; if ((!(inputFile.PostedFile == null) && (inputFile.PostedFile.ContentLength > 0))) { // Get the name of the file to be uploaded and // the location where the file needs to be saved. string extension = Path.GetExtension(inputFile.PostedFile.FileName); string saveLocation = (this.Page.Server.MapPath("..\\Data\\" + BUSINESSNAME.Text + "\\")); { try { // Save the file. inputFile.PostedFile.SaveAs(saveLocation + "CSB" + BUSINESSNAME.Text + extension); this.Page.Response.Write("The file has been uploaded."); } catch (Exception ex) { this.Page.Response.Write(("Error: " + ex.Message)); } this.Page.Response.Write(" file upload."); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)