I have a file upload tool in c# which allows users to upload an image but it only goes to my computer. Is there anyway I can make it upload to my mysql database?
Code for fileupload:
public void FileUpload(object sender, EventArgs e)
{
string fileName = FileUpload1.PostedFile.FileName;
string extension = Path.GetExtension(fileName);
if (extension.Equals(".gif") || extension.Equals(".jpg") || extension.Equals(".png"))
{
string path = Server.MapPath("~/");
FileUpload1.SaveAs(path + fileName);
Response.Write("File uploaded successfully");
}
else
{
Response.Write("File types: jpg, gif or png only.");
}
}
There's also a button that when clicked it uploads the file.
Any feedback would be appreciated. Thanks