I am trying to upload an image into my database as a `varbinary` data-type.

The problem is that I also want to store the image data from a byte array into a file that exists in my solution named `TextFile.txt`. But I am not able to do so.
I want it to write the data at the same time as inserting the image into the database.

I have this code, with which I am able to insert the image into the database, but not the byte data into the text file.

```cs
protected void Button1_Click(object sender, EventArgs e)   
{
    if (!this.FUImage.HasFile)
    {
        this.Label1.Text = "Please select a file to Uplaod";
        return;
    }

    MemoryStream ms = new MemoryStream();
    this.FUImage.PostedFile.InputStream.CopyTo(ms);
    var bytes = ms.ToArray();
    ms.Close();
    var image = new Image() {
        Name = this.FUImage.PostedFile.FileName,
        FileBinary = bytes
    };
    SaveImageData(image);
}

```