asked on
ASKER
string filepath = "C:\\Uploads";
HttpFileCollection uploadedFiles = Request.Files;
int i = 0;
while (!(i == uploadedFiles.Count))
{
HttpPostedFile userPostedFile = uploadedFiles(i);
try
{
if ((userPostedFile.ContentLength > 0))
{
Label1.Text += "<u>File #" + (i + 1) + "</u><br>";
Label1.Text += "File Content Type: " + userPostedFile.ContentType + "<br>";
Label1.Text += "File Size: " + userPostedFile.ContentLength + "kb<br>";
Label1.Text += "File Name: " + userPostedFile.FileName + "<br>";
userPostedFile.SaveAs(filepath + "\\" + System.IO.Path.GetFileName(userPostedFile.FileName));
Label1.Text += "Location where saved: " + filepath + "\\" + System.IO.Path.GetFileName(userPostedFile.FileName) + "<p>";
}
}
catch (Exception ex)
{
Label1.Text += "Error:<br>" + ex.Message;
}
i += 1;
}
ASKER
ASKER
ASKER
The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.
TRUSTED BY
try this sample code !!
Open in new window