(Code Behind file)
private void Submit1_ServerClick(object sender, System.EventArgs e)
{
if( (uploadfile.PostedFile != null ) && (uploadfile.PostedFile.ContentLength > 0 ) )
{
string fn = System.IO.Path.GetFileName(uploadfile.PostedFile.FileName);
string SaveLocation = Server.MapPath("Data") + "\\" + fn;
try
{
uploadfile.PostedFile.SaveAs(SaveLocation);
Response.Write("The file has been uploaded.");
}
catch ( Exception ex )
{
Response.Write("Error: " + ex.Message);
}
}
else
{
Response.Write("Please select a file to upload.");
}
}
Then you should change the httpRuntime
<
httpRuntime
executionTimeout="90"
maxRequestLength="4096"
useFullyQualifiedRedirectUrl="false"
minFreeThreads="8"
minLocalRequestFreeThreads="4"
appRequestQueueLimit="100"
/>
0 comments:
Post a Comment