我创建了一个提供图像上传功能的网站。 我以二进制格式插入了图像,并且还将完成编辑和删除,但现在要求将发生变化。
首先我将插入逻辑放在这里。
<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>
并在代码后面...
If (flLogo.HasFile.ToString()) Then
Dim File As HttpPostedFile = flLogo.PostedFile
imgByte = New Byte(File.ContentLength - 1) {}
File.InputStream.Read(imgByte, 0, File.ContentLength)
所以在 imagebyte 中我得到了二进制图像,然后插入数据库......
NOW MY Question Start. my boss ask me that get image from binary and store in folder with max Cust_id.
那么如何将二进制图像中的图像保存到文件夹中?
提前致谢
最佳答案
您可以直接保存图像:
Dim bmp As New Bitmap(flLogo.PostedFile.InputStream)
bmp.Save(yourPath)
关于asp.net - 从二进制文件获取图像并存储在文件夹中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30410364/