Narashi Hadiya
Narashi Hadiya

Reputation: 89

image get from binary and store in folder

I Have created a website where image upload functionality will be provide. i done the insert image in binary format and also Edit and delete will be done but now the requirement will be change.

first i put insert logic here.

  <tr>
                            <td valign="top" align="left" class="LabelFont">Logo :
                            </td>
                            <td width="74%" valign="top" align="left">
                                <asp:FileUpload ID="flLogo" runat="server"/> 

                            </td>
                        </tr>

and in code behind...

If (flLogo.HasFile.ToString()) Then
                Dim File As HttpPostedFile = flLogo.PostedFile
                imgByte = New Byte(File.ContentLength - 1) {}
                File.InputStream.Read(imgByte, 0, File.ContentLength)

SO in imagebyte i get the binary image after that i insert in in database ...

NOW MY Question Start. my boss ask me that get image from binary and store in folder with max Cust_id.

So How to save image in folder from binary image ?

Thanks in Advance

Upvotes: 2

Views: 382

Answers (1)

Muhammad
Muhammad

Reputation: 1340

You can save the image directly:

Dim bmp As New Bitmap(flLogo.PostedFile.InputStream)
bmp.Save(yourPath)

Upvotes: 2

Related Questions