Stem Cells Blood Banks Insurances .Net Hosting Credit Cards PC Rental Business
Tutorials: ASP .NET C# .NET VB .NET Articles: ASP .NET C# .NET VB .NET Fast Code: ASP .NET C# .NET VB .NET
1. Save the File to your specified distination // Specify the path on the server to save the uploaded file to. String savePath = @"c:\root\uploads\"; // Before attempting to perform operations/ on the file, verify that the FileUpload // control contains a file. if (FileUpload1.HasFile) { // Get the name of the file to upload. String fileName = FileUpload1.FileName; // Append the name of the file to upload to the path. savePath += fileName; FileUpload1.SaveAs(savePath); } 2. Save files to a specified directory using PhysicalApplicationPath // specif y the upload Directory to cater the website files overwrite like web.config. string saveDir = @"\Uploads\"; // Get the physical file system path for the currently executing application. string appPath = Request.PhysicalApplicationPath;
Pretty neat and straightforward article. Great!!!
04/09/2007 14:31:05 UTC