»Dotnet Ads
»Message Boards
Message Boards
Dotnet Books
»Member Details
Register
Login
LogOut
Submit Code
Submit Jobs
Submit Projects
»Competition
Community
Winners
Prizes
Write For Us
Members
»Other Resources
Links
Dotnet Resources
|
Uploading a file in asp.netIn this small article i will show you how to uploading a file from asp.net
For uploading files we have to set the form mimetype as below. Otherwise file data could not be sent
Now add the html file control to the page
Then add a button to upload a file once a file is selecte
In the onclick event of the upload button add
private void uploadButton_Click(object sender, System.EventArgs e)
{
//check to see if a file is uploaded
if(File1.PostedFile != null)
{
//save it
File1.PostedFile.SaveAs("filename.txt");
}
}
|
That's it :)
|