Please help with code to replace existing avatar in database.
I am using vb. Here is my existing code that I use to upload images to database. I need to replace the existing image on button click. If anyone knows any samples that would be great. Thank you.
If FileUpload_ImageUpload.PostedFile Is Nothing OrElse String.IsNullOrEmpty(FileUpload_ImageUpload.PostedFile.FileName) OrElse FileUpload_ImageUpload.PostedFile.InputStream Is Nothing Then
Return
End If
Dim extension As String = Path.GetExtension(FileUpload_ImageUpload.PostedFile.FileName).ToLower()
Dim MIMEType As String = Nothing
Select Case extension
Case ".gif"
MIMEType = "image/gif"
Exit Select
Case ".jpg", ".jpeg", ".jpe"
MIMEType = "image/jpeg"
Exit Select
Case ".png"
MIMEType = "image/png"
Exit Select
Case Else
'Invali ...
Go to the complete details ...