Friday, February 19, 2010

File Uploader using asp.net c#

No comments:
web.config
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true"/>
<httpRuntime executionTimeout="90" maxRequestLength="200000" useFullyQualifiedRedirectUrl="false" minFreeThreads="8" minLocalRequestFreeThreads="4" appRequestQueueLimit="100"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>


  • Default.aspx.cs File
static string fn1;
protected void BtnUpload_Click(object sender, EventArgs e)
{
try
{
if ((FileUploader.HasFile) && (FileUploader.PostedFile.ContentLength > 0) && FileUploader.PostedFile.ContentLength <= 20000000)
{
fn1 = System.IO.Path.GetFileName(FileUploader.PostedFile.FileName);
string SaveLocation = Server.MapPath("public_files") + "\\" + fn1;FileUploader.PostedFile.SaveAs(SaveLocation);
lbMessage.Text = "Upload successess... Have a nice day...<a href='http://www.twitter.com/rodriguesjax'>Go to Twitter </a><p>Files saved to " + SaveLocation + "</p>";
}
else
{
lbMessage.Text = "please select a file less than 20MB and greater than 0MB.";
}
}
catch (Exception ex)
{
lbMessage.Text = "Sorry. Upload Failed : " + ex.Message;
}
}

Sunday, February 14, 2010

Google Buzz for mobile

No comments:
Google Buzz for mobile allows you to see what's going on around you, post messages tagged with your location, and keep up with your friends on the go. Visit buzz.google.com from your phone's mobile...