Upload Images To SQL Server By Way Of An ASP.NET Web Form
Posted by: Radical Development,
on 11 Aug 2007 |
View original | Bookmarked: 0 time(s)
First thing you must do is create your form.
The controls used above are:
TextBox
UploadFile
Button
Label
Next the button event click should contain the following:
protected void UploadBtn_Click(object sender, EventArgs e)
{
Stream imgStream = UploadFile.PostedFile.InputStream;
int imgLen = UploadFile.PostedFile.ContentLength;
string imgContentType = UploadFile.PostedFile.ContentType;
string imgName = txtImgName.Value;
byte[] imgBinaryData = new byte[imgLen];
...