asp.net the files in the binary save and read the form database
Data Sheet Section
Front desk-file_upload.aspx
<%@ Page language= "C #" autoeventwireup= "true" codefile= "File_Upload.aspx.cs" inherits= "File_upload"%>
<! DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 transitional//en" "Http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<title> multi-File upload </title>
<script language= "JavaScript" >
function AddFile ()
{
var str = ' <input type= "file" size= "name=" file ">"
document.getElementById (' MyFile '). insertAdjacentHTML ("BeforeEnd", str)
}
</script>
<body>
<form id= "Form2" method= "POST" runat= "server" enctype= "Multipart/form-data" >
<div align= "center" >
<p id= "MyFile" ><input type= "file" size= "$" name= "file" ></P>
<P>
<input type= "button" value= "Add" onclick= "AddFile ()" >
<input onclick= "This.form.reset ()" type= "button" value= "Reset" >
<asp:button runat= "Server" text= "Start uploading" id= "Button1" onclick= "Uploadbutton_click" ></asp:Button>
</P>
<P>
<asp:label id= "strstatus" runat= "server" font-names= "Arial" font-bold= "True" font-size= "9pt"
Width= "500px" borderstyle= "None" bordercolor= "white" ></asp:Label>
</P>
<br/>
<asp:gridview id= "GridView1" runat= "Server" autogeneratecolumns= "False" width= "335px" onrowcommand= "Gridview_" Rowcommand ">
<Columns>
<asp:boundfield datafield= "id" headertext= "id"/>
<asp:boundfield datafield= "Name"/>
<asp:buttonfield buttontype= "Image" commandname= "Download" headertext= "Download" imageurl= "~/images/mailto.gif"
text= "Download"/>
</Columns>
</asp:GridView>
</div>
</form>
</body>
</HTML>
Background: File_Upload.aspx.cs
Using System;
Using System.Data;
Using System.Configuration;
Using System.Collections;
Using System.Web;
Using System.Web.Security;
Using System.Web.UI;
Using System.Web.UI.WebControls;
Using System.Web.UI.WebControls.WebParts;
Using System.Web.UI.HtmlControls;
Using System.IO;
Using SYSTEM.DATA.SQL;
Using System.Data.SqlClient;
public partial class File_Upload:System.Web.UI.Page
{
private string connstring;
private void Initaldb ()
{
String uid = System.Configuration.ConfigurationManager.AppSettings.Get ("UID");
string pwd = System.Configuration.ConfigurationManager.AppSettings.Get ("pwd");
String server = System.Configuration.ConfigurationManager.AppSettings.Get ("server");
string database = SYSTEM.CONFIGURATION.CONFIGURATIONMANAGER.APPSETTINGS.G